package view;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
import Comparators.GastoReceitasDataComparator;
import Comparators.GastoReceitasNomeComparator;
import Comparators.TipoGRNomeComparator;
import Comparators.UsuarioNomeComparator;
import Filters.GastoReceitasFilter;
import Filters.InvestimentoFilter;
import Filters.UsuarioFilter;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import beans.*;
import java.util.Date;
import net.sourceforge.floggy.persistence.FloggyException;
import net.sourceforge.floggy.persistence.ObjectSet;
import net.sourceforge.floggy.persistence.PersistableManager;
import org.netbeans.microedition.lcdui.SimpleTableModel;
import org.netbeans.microedition.lcdui.SplashScreen;
import org.netbeans.microedition.lcdui.TableItem;
import utilities.Calendario;
import utilities.FloggyUtility;
import utilities.Login;

/**
 * @author gustavo
 */
public class SistemaControleFinanceiroPrincipal extends MIDlet implements CommandListener, ItemCommandListener {

    private boolean midletPaused = false;
    private Usuario usuario = new Usuario();
    private TiposGastosReceitas tipoGR = new TiposGastosReceitas();
    private GastosReceitas gastosReceitas = new GastosReceitas();
    private FloggyUtility fu = new FloggyUtility();
    private Usuario gUsuario;
    private TextField txtNumParcelasGR;
    private TextField txtQuantDiasGR;
    private Investimentos investimento = new Investimentos();
    //<editor-fold defaultstate="collapsed" desc=" Generated Fields ">//GEN-BEGIN:|fields|0|
    private Form CadastroUsuario;
    private TextField login;
    private TextField nome;
    private TextField senha;
    private Alert AlertCadastrado;
    private TextBox ComofazerumCadastro;
    private List Principal;
    private Form TelaLogin;
    private TextField txtLoginLogin;
    private TextField txtSenhaLogin;
    private SplashScreen splashScreen;
    private Form frmCadGastosReceitas;
    private ChoiceGroup cgTipoGR;
    private TextField txtNomeGR;
    private DateField dfDataPagamentoGR;
    private ChoiceGroup cgCompensadoGR;
    private DateField dfDataEmissaoGR;
    private DateField dfDataVencimentoGR;
    private TextField txtDescricaoGR;
    private TextField txtValorGR;
    private List listUsuario;
    private Form frmCadTipoGastosReceitas;
    private ChoiceGroup cgDebitoCredito;
    private TextField txtNomeTipoGR;
    private Alert alertTipoGRCadastro;
    private List listTipoGastosReceitas;
    private Alert alertTipoGRDelete;
    private Alert alertLogin;
    private Alert alertUsuarioDelete;
    private Alert alertGRCadastro;
    private List listGastosReceitas;
    private Alert alertGRDelete;
    private List listGastosReceitasTiposGR;
    private Alert alertInvestimento;
    private Form frmCadInvestimento;
    private TextField txtDescricao;
    private TextField txtValorUltAt;
    private DateField dfDataUltAt;
    private TextField txtValorAntInvest;
    private TextField txtNome;
    private Form frmRelGastoReceitas;
    private DateField dfDeRelGR;
    private ChoiceGroup cgRelGastosReceitas;
    private StringItem lblPeriodo;
    private DateField dfAteRelGR;
    private ChoiceGroup cgData;
    private Alert alertSaldo;
    private List listRelatorio;
    private TextBox tbxRelatorio;
    private Alert alertRelGR;
    private List listInvestimentos;
    private Form frmVisRelGR;
    private TableItem tbRelGR;
    private Command cmdOKCadastroUsuario;
    private Command cmdExitCadastroUsuario;
    private Command cmdHelpCadastroUsuario;
    private Command cmdExitHelpCadUsuario;
    private Command cmdExitPrincipal;
    private Command cmdOKLogin;
    private Command cmdExitLogin;
    private Command cmdExitCadGR;
    private Command cmdOKCadGR;
    private Command cmdNovoCadGR;
    private Command cmdScreenListaTiposGR;
    private Command cmdExitTipoGRPrincipal;
    private Command cmdListaUsuario;
    private Command cmdBackListUsuarioCadUsuario;
    private Command cmdOKListTipoGR;
    private Command cmdBackListTipoGRFrmCadTipoGR;
    private Command cmdOKTipoGR;
    private Command cmdListTipoGR;
    private Command cmdDeleteTipoGR;
    private Command cmdDeleteUsuario;
    private Command cmdNovoTipoGR;
    private Command cmdNovoUsuario;
    private Command cmdExitAlertLogin;
    private Command cmdOKListUsuario;
    private Command cmdDeleteGR;
    private Command cmdBackListGRCadGR;
    private Command cmdOKListGR;
    private Command cmdScreenLoginCadUsuario;
    private Command cmdBackListTiposGRCadGR;
    private Command cmdOKListGOTiposGR;
    private Command cmdScreenGastosReceitas;
    private Command cmdExitInvestimento;
    private Command cmdOkInvestimento;
    private Command cmdCancelGastosReceitas;
    private Command cmdCancelTiposGr;
    private Command cmdExitRelatorio;
    private Command cmdExitRelGastosReceitas;
    private Command cmdOkRelGastosReceitas;
    private Command cmdOkRelatorio;
    private Command cmdExitListInvest;
    private Command cmdOkListInvest;
    private Command cmdBackAlertRelGRRelGR;
    private Command cmdCancelInvest;
    private Command itemCommand;
    private Command cmdNovoInvest;
    private Command cmdDeleteInvest;
    private Command cmdItemInvestimento;
    private Command cmdOKFrmVisRelGR;
    private Ticker tickerListTipos_GastoReceitas;
    private Ticker ticker;
    private Image image1;
    private Font font;
    private SimpleTableModel tableModel;
    //</editor-fold>//GEN-END:|fields|0|

    //</editor-fold>
    /**
     * The SistemaControleFinanceiroPrincipal constructor.
     */
    public SistemaControleFinanceiroPrincipal() {
    }

    public void montaGastoReceita(TiposGastosReceitas tipoGRAux) throws NumberFormatException {
        gastosReceitas.setUsuario(gUsuario);
        gastosReceitas.setTipoGR(tipoGRAux);
        gastosReceitas.setNome(txtNomeGR.getString());
        gastosReceitas.setDescricao(txtDescricaoGR.getString());
        gastosReceitas.setValor(Double.parseDouble(getTxtValorGR().getString()));
        gastosReceitas.setCompensado(cgCompensadoGR.isSelected(0));
        gastosReceitas.setDataEmissao(dfDataEmissaoGR.getDate());
        gastosReceitas.setDataPagamento(dfDataPagamentoGR.getDate());
        gastosReceitas.setDataVencimento(dfDataVencimentoGR.getDate());
    }

    private void gravaTelaGastosReceitas(TiposGastosReceitas tipoGRAux) throws NumberFormatException {
        if (frmCadGastosReceitas.size() > 8 && txtQuantDiasGR != null &&
                txtNumParcelasGR != null && gastosReceitas.getId() == 0) {
            long quantDias = Long.parseLong(txtQuantDiasGR.getString());
            quantDias = quantDias * 24 * 60 * 60 * 1000;
            long aux = quantDias + gastosReceitas.getDataVencimento().getTime();
            final int numeroPar = Integer.parseInt(txtNumParcelasGR.getString());
            for (int i = 0; i < numeroPar; i++) {
                gastosReceitas = new GastosReceitas();
                montaGastoReceita(tipoGRAux);
                if (i != 0) {
                    Date d = new Date();
                    d.setTime(aux);
                    gastosReceitas.setDataVencimento(d);
                }
                gastosReceitas.save();
                aux = aux + quantDias;
            }
            if (numeroPar == 0) {
                gastosReceitas.save();
            }
        } else {
            montaGastoReceita(tipoGRAux);
            gastosReceitas.save();
        }
    }


    //<editor-fold defaultstate="collapsed" desc=" Generated Methods ">//GEN-BEGIN:|methods|0|
    //</editor-fold>//GEN-END:|methods|0|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: initialize ">//GEN-BEGIN:|0-initialize|0|0-preInitialize
    /**
     * Initilizes the application.
     * It is called only once when the MIDlet is started. The method is called before the <code>startMIDlet</code> method.
     */
    private void initialize() {//GEN-END:|0-initialize|0|0-preInitialize
        // write pre-initialize user code here
//GEN-LINE:|0-initialize|1|0-postInitialize
        // write post-initialize user code here
    }//GEN-BEGIN:|0-initialize|2|
    //</editor-fold>//GEN-END:|0-initialize|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: startMIDlet ">//GEN-BEGIN:|3-startMIDlet|0|3-preAction
    /**
     * Performs an action assigned to the Mobile Device - MIDlet Started point.
     */
    public void startMIDlet() {//GEN-END:|3-startMIDlet|0|3-preAction
        // write pre-action user code here
        switchDisplayable(null, getSplashScreen());//GEN-LINE:|3-startMIDlet|1|3-postAction
    // write post-action user code here
    }//GEN-BEGIN:|3-startMIDlet|2|
    //</editor-fold>//GEN-END:|3-startMIDlet|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: resumeMIDlet ">//GEN-BEGIN:|4-resumeMIDlet|0|4-preAction
    /**
     * Performs an action assigned to the Mobile Device - MIDlet Resumed point.
     */
    public void resumeMIDlet() {//GEN-END:|4-resumeMIDlet|0|4-preAction
        // write pre-action user code here
//GEN-LINE:|4-resumeMIDlet|1|4-postAction
        // write post-action user code here
    }//GEN-BEGIN:|4-resumeMIDlet|2|
    //</editor-fold>//GEN-END:|4-resumeMIDlet|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: switchDisplayable ">//GEN-BEGIN:|5-switchDisplayable|0|5-preSwitch
    /**
     * Switches a current displayable in a display. The <code>display</code> instance is taken from <code>getDisplay</code> method. This method is used by all actions in the design for switching displayable.
     * @param alert the Alert which is temporarily set to the display; if <code>null</code>, then <code>nextDisplayable</code> is set immediately
     * @param nextDisplayable the Displayable to be set
     */
    public void switchDisplayable(Alert alert, Displayable nextDisplayable) {//GEN-END:|5-switchDisplayable|0|5-preSwitch
        // write pre-switch user code here
        Display display = getDisplay();//GEN-BEGIN:|5-switchDisplayable|1|5-postSwitch
        if (alert == null) {
            display.setCurrent(nextDisplayable);
        } else {
            display.setCurrent(alert, nextDisplayable);
        }//GEN-END:|5-switchDisplayable|1|5-postSwitch
    // write post-switch user code here
    }//GEN-BEGIN:|5-switchDisplayable|2|
    //</editor-fold>//GEN-END:|5-switchDisplayable|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: commandAction for Displayables ">//GEN-BEGIN:|7-commandAction|0|7-preCommandAction
    /**
     * Called by a system to indicated that a command has been invoked on a particular displayable.
     * @param command the Command that was invoked
     * @param displayable the Displayable where the command was invoked
     */
    public void commandAction(Command command, Displayable displayable) {//GEN-END:|7-commandAction|0|7-preCommandAction
        // write pre-action user code here
        if (displayable == CadastroUsuario) {//GEN-BEGIN:|7-commandAction|1|175-preAction
            if (command == cmdDeleteUsuario) {//GEN-END:|7-commandAction|1|175-preAction
                fu.delete(usuario, usuario.getId());
                switchDisplayable(getAlertUsuarioDelete(), getCadastroUsuario());//GEN-LINE:|7-commandAction|2|175-postAction
                usuario = new Usuario();
                getNome().setString("");
                getLogin().setString("");
                getSenha().setString("");
            } else if (command == cmdExitCadastroUsuario) {//GEN-LINE:|7-commandAction|3|25-preAction
                if (gUsuario != null) {
                    switchDisplayable(null, getPrincipal());//GEN-LINE:|7-commandAction|4|25-postAction
                } else {
                    switchDisplayable(null, getTelaLogin());
                }
            } else if (command == cmdHelpCadastroUsuario) {//GEN-LINE:|7-commandAction|5|31-preAction
                // write pre-action user code here
                switchDisplayable(null, getComofazerumCadastro());//GEN-LINE:|7-commandAction|6|31-postAction
            // write post-action user code here
            } else if (command == cmdListaUsuario) {//GEN-LINE:|7-commandAction|7|129-preAction
                // write pre-action user code here
                if (gUsuario != null) {
                    ObjectSet os = null;
                    Usuario usuarioAux = new Usuario();
                    getListUsuario().deleteAll();
                    try {
                        os = fu.findComparator(usuarioAux, new UsuarioNomeComparator());
                        for (int i = 0; i < os.size(); i++) {
                            usuarioAux = (Usuario) os.get(i);
                            getListUsuario().append(usuarioAux.getId() + " - " + usuarioAux.getNome() + "\n", null);
                        }
                    } catch (FloggyException ex) {
                        ex.printStackTrace();
                    }
                    switchDisplayable(null, getListUsuario());//GEN-LINE:|7-commandAction|8|129-postAction
                }
            } else if (command == cmdNovoUsuario) {//GEN-LINE:|7-commandAction|9|165-preAction
                usuario = new Usuario();
                switchDisplayable(null, getCadastroUsuario());//GEN-LINE:|7-commandAction|10|165-postAction
                getNome().setString("");
                getLogin().setString("");
                getSenha().setString("");
            } else if (command == cmdOKCadastroUsuario) {//GEN-LINE:|7-commandAction|11|22-preAction
                usuario.setNome(nome.getString());
                usuario.setLogin(login.getString());
                usuario.setSenha(senha.getString());
                if (Login.procuraLogin(usuario)) {
                    usuario.save();
                    getNome().setString("");
                    getLogin().setString("");
                    getSenha().setString("");
                    getAlertCadastrado().setString("Usuário cadastrado com sucesso!");
                } else {
                    getAlertCadastrado().setString("Login já existente, altere-o!");
                }
                switchDisplayable(getAlertCadastrado(), getCadastroUsuario());//GEN-LINE:|7-commandAction|12|22-postAction

            }//GEN-BEGIN:|7-commandAction|13|39-preAction
        } else if (displayable == ComofazerumCadastro) {
            if (command == cmdExitHelpCadUsuario) {//GEN-END:|7-commandAction|13|39-preAction
                // write pre-action user code here
                switchDisplayable(null, getCadastroUsuario());//GEN-LINE:|7-commandAction|14|39-postAction
            // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|15|48-preAction
        } else if (displayable == Principal) {
            if (command == List.SELECT_COMMAND) {//GEN-END:|7-commandAction|15|48-preAction
                // write pre-action user code here
                PrincipalAction();//GEN-LINE:|7-commandAction|16|48-postAction
            // write post-action user code here
            } else if (command == cmdExitPrincipal) {//GEN-LINE:|7-commandAction|17|59-preAction
                // write pre-action user code here
                exitMIDlet();//GEN-LINE:|7-commandAction|18|59-postAction
            // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|19|79-preAction
        } else if (displayable == TelaLogin) {
            if (command == cmdExitLogin) {//GEN-END:|7-commandAction|19|79-preAction
                // write pre-action user code here
                exitMIDlet();//GEN-LINE:|7-commandAction|20|79-postAction
            // write post-action user code here
            } else if (command == cmdOKLogin) {//GEN-LINE:|7-commandAction|21|77-preAction
                Usuario usuarioAux = new Usuario();
                usuarioAux.setLogin(txtLoginLogin.getString());
                usuarioAux.setSenha(txtSenhaLogin.getString());
                if (Login.autenticar(usuarioAux)) {
                    gUsuario = new Usuario();
                    ObjectSet os = fu.findFilterAndComparator(gUsuario, new UsuarioFilter(usuarioAux.getLogin(), 'L'), new UsuarioNomeComparator());
                    try {
                        gUsuario = (Usuario) os.get(0);
                    } catch (FloggyException ex) {
                        ex.printStackTrace();
                    }
                    switchDisplayable(null, getPrincipal());//GEN-LINE:|7-commandAction|22|77-postAction
                } else {
                    switchDisplayable(null, getAlertLogin());
                }
            } else if (command == cmdScreenLoginCadUsuario) {//GEN-LINE:|7-commandAction|23|193-preAction
                // write pre-action user code here
                switchDisplayable(null, getCadastroUsuario());//GEN-LINE:|7-commandAction|24|193-postAction
            // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|25|190-preAction
        } else if (displayable == alertLogin) {
            if (command == cmdExitAlertLogin) {//GEN-END:|7-commandAction|25|190-preAction
                // write pre-action user code here
                switchDisplayable(null, getTelaLogin());//GEN-LINE:|7-commandAction|26|190-postAction
            // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|27|313-preAction
        } else if (displayable == alertRelGR) {
            if (command == cmdBackAlertRelGRRelGR) {//GEN-END:|7-commandAction|27|313-preAction
                // write pre-action user code here
                switchDisplayable(null, getFrmRelGastoReceitas());//GEN-LINE:|7-commandAction|28|313-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|29|225-preAction
        } else if (displayable == frmCadGastosReceitas) {
            if (command == cmdCancelGastosReceitas) {//GEN-END:|7-commandAction|29|225-preAction
                // write pre-action user code here
//GEN-LINE:|7-commandAction|30|225-postAction
                // write post-action user code here
            } else if (command == cmdDeleteGR) {//GEN-LINE:|7-commandAction|31|206-preAction
                fu.delete(gastosReceitas, gastosReceitas.getId());
                switchDisplayable(getAlertGRDelete(), getFrmCadGastosReceitas());//GEN-LINE:|7-commandAction|32|206-postAction
                limpaTelaGastosReceitas();
                gastosReceitas = new GastosReceitas();
            } else if (command == cmdExitCadGR) {//GEN-LINE:|7-commandAction|33|95-preAction
                // write pre-action user code here
                switchDisplayable(null, getPrincipal());//GEN-LINE:|7-commandAction|34|95-postAction
                // write post-action user code here
                if (frmCadGastosReceitas.size() > 8) {
                    frmCadGastosReceitas.delete(frmCadGastosReceitas.size() - 1);
                    frmCadGastosReceitas.delete(frmCadGastosReceitas.size() - 1);
                    txtQuantDiasGR = null;
                    txtNumParcelasGR = null;
                }
            } else if (command == cmdNovoCadGR) {//GEN-LINE:|7-commandAction|35|97-preAction
                gastosReceitas = new GastosReceitas();
                switchDisplayable(null, getFrmCadGastosReceitas());//GEN-LINE:|7-commandAction|36|97-postAction
                limpaTelaGastosReceitas();
            } else if (command == cmdOKCadGR) {//GEN-LINE:|7-commandAction|37|99-preAction
                TiposGastosReceitas tipoGRAux = new TiposGastosReceitas();
                tipoGRAux.setId(Integer.parseInt(cgTipoGR.getString(cgTipoGR.getSelectedIndex()).substring(0, 1)));
                try {
                    PersistableManager.getInstance().load(tipoGRAux, tipoGRAux.getId());
                } catch (FloggyException ex) {
                    ex.printStackTrace();
                }
                gravaTelaGastosReceitas(tipoGRAux);
                switchDisplayable(getAlertGRCadastro(), getFrmCadGastosReceitas());//GEN-LINE:|7-commandAction|38|99-postAction
                limpaTelaGastosReceitas();
                gastosReceitas = new GastosReceitas();
            } else if (command == cmdScreenGastosReceitas) {//GEN-LINE:|7-commandAction|39|215-preAction
                ObjectSet os = null;
                GastosReceitas grAux = new GastosReceitas();
                getListGastosReceitas().deleteAll();
                try {
                    os = fu.findFilterAndComparator(grAux, new GastoReceitasFilter(gUsuario, null, 'U'), new GastoReceitasNomeComparator());
                    for (int i = 0; i < os.size(); i++) {
                        grAux = (GastosReceitas) os.get(i);
                        getListGastosReceitas().append(grAux.getId() + " - " + grAux.getNome() +
                                " - " + Calendario.retornaDataDDMMAAAA(grAux.getDataVencimento()) + "\n", null);
                    }
                } catch (FloggyException ex) {
                    ex.printStackTrace();
                }
                switchDisplayable(null, getListGastosReceitas());//GEN-LINE:|7-commandAction|40|215-postAction
            // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|41|290-preAction
        } else if (displayable == frmCadInvestimento) {
            if (command == cmdCancelInvest) {//GEN-END:|7-commandAction|41|290-preAction
                // write pre-action user code here
//GEN-LINE:|7-commandAction|42|290-postAction
                // write post-action user code here
            } else if (command == cmdDeleteInvest) {//GEN-LINE:|7-commandAction|43|297-preAction
                // write pre-action user code here
                fu.delete(investimento, investimento.getId());
                switchDisplayable(null, getFrmCadInvestimento());//GEN-LINE:|7-commandAction|44|297-postAction
                limpaTelaInvestimento();
                investimento = new Investimentos();
            // write post-action user code here
            } else if (command == cmdExitInvestimento) {//GEN-LINE:|7-commandAction|45|234-preAction
                // write pre-action user code here
                switchDisplayable(null, getPrincipal());//GEN-LINE:|7-commandAction|46|234-postAction
            // write post-action user code here
            } else if (command == cmdItemInvestimento) {//GEN-LINE:|7-commandAction|47|303-preAction
                // write pre-action user code here

                ObjectSet os = null;
                Investimentos inAux = new Investimentos();
                getListInvestimentos().deleteAll();
                try {
                    os = fu.findFilter(inAux, new InvestimentoFilter(gUsuario, null, 'U'));
                    for (int i = 0; i < os.size(); i++) {
                        inAux = (Investimentos) os.get(i);
                        getListInvestimentos().append(inAux.getId() + " - " + inAux.getNome() +
                                " - " + Calendario.retornaDataDDMMAAAA(inAux.getDataUltAt()) + "\n", null);
                    }
                } catch (FloggyException ex) {
                    ex.printStackTrace();
                }


                switchDisplayable(null, getListInvestimentos());//GEN-LINE:|7-commandAction|48|303-postAction
            // write post-action user code here
            } else if (command == cmdNovoInvest) {//GEN-LINE:|7-commandAction|49|294-preAction
                // write pre-action user code here
                gastosReceitas = new GastosReceitas();
                switchDisplayable(null, getFrmCadInvestimento());//GEN-LINE:|7-commandAction|50|294-postAction
                limpaTelaInvestimento();
            // write post-action user code here
            } else if (command == cmdOkInvestimento) {//GEN-LINE:|7-commandAction|51|232-preAction
                investimento.setNome(txtNome.getString());
                investimento.setDescricao(txtDescricao.getString());
                if (txtValorAntInvest.getString().trim().length() == 0) {
                    investimento.setValorAnterior(0.0);
                } else {
                    investimento.setValorAnterior(Double.parseDouble(txtValorAntInvest.getString()));
                }
                investimento.setValorAtual(Double.parseDouble(txtValorUltAt.getString()));
                investimento.setDataUltAt(dfDataUltAt.getDate());
                investimento.setUsuario(gUsuario);
                investimento.save();
                switchDisplayable(getAlertInvestimento(), getFrmCadInvestimento());//GEN-LINE:|7-commandAction|52|232-postAction
                limpaTelaInvestimento();
            // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|53|283-preAction
        } else if (displayable == frmCadTipoGastosReceitas) {
            if (command == cmdCancelTiposGr) {//GEN-END:|7-commandAction|53|283-preAction
                // write pre-action user code here
//GEN-LINE:|7-commandAction|54|283-postAction
                // write post-action user code here
            } else if (command == cmdDeleteTipoGR) {//GEN-LINE:|7-commandAction|55|171-preAction
                fu.delete(tipoGR, tipoGR.getId());
                switchDisplayable(getAlertTipoGRDelete(), getFrmCadTipoGastosReceitas());//GEN-LINE:|7-commandAction|56|171-postAction
                txtNomeTipoGR.setString("");
                cgDebitoCredito.setSelectedIndex(0, true);
                tipoGR = new TiposGastosReceitas();
            } else if (command == cmdExitTipoGRPrincipal) {//GEN-LINE:|7-commandAction|57|143-preAction
                // write pre-action user code here
                switchDisplayable(null, getPrincipal());//GEN-LINE:|7-commandAction|58|143-postAction
            // write post-action user code here
            } else if (command == cmdListTipoGR) {//GEN-LINE:|7-commandAction|59|148-preAction
                ObjectSet os = null;
                TiposGastosReceitas tipoGRaux = new TiposGastosReceitas();
                getListTipoGastosReceitas().deleteAll();
                try {
                    os = fu.findComparator(tipoGRaux, new TipoGRNomeComparator());
                    for (int i = 0; i < os.size(); i++) {
                        tipoGRaux = (TiposGastosReceitas) os.get(i);
                        getListTipoGastosReceitas().append(tipoGRaux.getId() + " - " + tipoGRaux.getNome() + " - " + tipoGRaux.getDebitoCredito() + "\n", null);
                    }
                } catch (FloggyException ex) {
                    ex.printStackTrace();
                }
                switchDisplayable(null, getListTipoGastosReceitas());//GEN-LINE:|7-commandAction|60|148-postAction
            // write post-action user code here
            } else if (command == cmdNovoTipoGR) {//GEN-LINE:|7-commandAction|61|168-preAction
                tipoGR = new TiposGastosReceitas();
                switchDisplayable(null, getFrmCadTipoGastosReceitas());//GEN-LINE:|7-commandAction|62|168-postAction
                txtNomeTipoGR.setString("");
            } else if (command == cmdOKTipoGR) {//GEN-LINE:|7-commandAction|63|146-preAction
                // write pre-action user code here                
                tipoGR.setNome(txtNomeTipoGR.getString());
                if (cgDebitoCredito.getSelectedIndex() == 0) {
                    tipoGR.setDebitoCredito('D');
                } else {
                    tipoGR.setDebitoCredito('C');
                }
                tipoGR.save();
                switchDisplayable(getAlertTipoGRCadastro(), getFrmCadTipoGastosReceitas());//GEN-LINE:|7-commandAction|64|146-postAction
                // write post-action user code here
                txtNomeTipoGR.setString("");
                cgDebitoCredito.setSelectedIndex(0, true);
                tipoGR = new TiposGastosReceitas();
            }//GEN-BEGIN:|7-commandAction|65|264-preAction
        } else if (displayable == frmRelGastoReceitas) {
            if (command == cmdExitRelGastosReceitas) {//GEN-END:|7-commandAction|65|264-preAction
                // write pre-action user code here
                switchDisplayable(null, getListRelatorio());//GEN-LINE:|7-commandAction|66|264-postAction
            // write post-action user code here
            } else if (command == cmdOkRelGastosReceitas) {//GEN-LINE:|7-commandAction|67|262-preAction
                if (!validaFiltroRelGastoReceita()) {
                    getAlertRelGR().setString("Selecione o tipo de Lançamento!");
                    switchDisplayable(null, getAlertRelGR());
                } else {
                    //getTbxRelatorio().setString(montaTexto());
                    montaTexto();
                    getTableModel().fireTableModelChanged();
                    getTbRelGR().setModel(getTableModel());
                    switchDisplayable(null, getFrmVisRelGR());//GEN-LINE:|7-commandAction|68|262-postAction
                }
            // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|69|318-preAction
        } else if (displayable == frmVisRelGR) {
            if (command == cmdOKFrmVisRelGR) {//GEN-END:|7-commandAction|69|318-preAction
                // write pre-action user code here
                switchDisplayable(null, getFrmRelGastoReceitas());//GEN-LINE:|7-commandAction|70|318-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|71|196-preAction
        } else if (displayable == listGastosReceitas) {
            if (command == List.SELECT_COMMAND) {//GEN-END:|7-commandAction|71|196-preAction
                // write pre-action user code here
                listGastosReceitasAction();//GEN-LINE:|7-commandAction|72|196-postAction
            // write post-action user code here
            } else if (command == cmdBackListGRCadGR) {//GEN-LINE:|7-commandAction|73|202-preAction
                // write pre-action user code here
                switchDisplayable(null, getFrmCadGastosReceitas());//GEN-LINE:|7-commandAction|74|202-postAction
            // write post-action user code here
            } else if (command == cmdOKListGR) {//GEN-LINE:|7-commandAction|75|200-preAction
                gastosReceitas.setId(Integer.parseInt(listGastosReceitas.getString(listGastosReceitas.getSelectedIndex()).substring(0,
                        listGastosReceitas.getString(listGastosReceitas.getSelectedIndex()).indexOf(" -"))));
                try {
                    // write pre-action user code here
                    PersistableManager.getInstance().load(gastosReceitas, gastosReceitas.getId());
                } catch (FloggyException ex) {
                    ex.printStackTrace();
                }
                preencheTelaGastosReceitas();
                switchDisplayable(null, getFrmCadGastosReceitas());//GEN-LINE:|7-commandAction|76|200-postAction
            // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|77|212-preAction
        } else if (displayable == listGastosReceitasTiposGR) {
            if (command == List.SELECT_COMMAND) {//GEN-END:|7-commandAction|77|212-preAction
                // write pre-action user code here
                listGastosReceitasTiposGRAction();//GEN-LINE:|7-commandAction|78|212-postAction
            // write post-action user code here
            } else if (command == cmdBackListTiposGRCadGR) {//GEN-LINE:|7-commandAction|79|221-preAction
                // write pre-action user code here
                switchDisplayable(null, getFrmCadGastosReceitas());//GEN-LINE:|7-commandAction|80|221-postAction
            // write post-action user code here
            } else if (command == cmdOKListGOTiposGR) {//GEN-LINE:|7-commandAction|81|219-preAction
                getCgTipoGR().deleteAll();
                getCgTipoGR().append(listGastosReceitasTiposGR.getString(listGastosReceitasTiposGR.getSelectedIndex()), null);
                switchDisplayable(null, getFrmCadGastosReceitas());//GEN-LINE:|7-commandAction|82|219-postAction
            // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|83|300-preAction
        } else if (displayable == listInvestimentos) {
            if (command == List.SELECT_COMMAND) {//GEN-END:|7-commandAction|83|300-preAction
                // write pre-action user code here
                listInvestimentosAction();//GEN-LINE:|7-commandAction|84|300-postAction
            // write post-action user code here
            } else if (command == cmdExitListInvest) {//GEN-LINE:|7-commandAction|85|306-preAction
                // write pre-action user code here
                switchDisplayable(null, getFrmCadInvestimento());//GEN-LINE:|7-commandAction|86|306-postAction
            // write post-action user code here
            } else if (command == cmdOkListInvest) {//GEN-LINE:|7-commandAction|87|309-preAction
                // write pre-action user code here

                investimento.setId(Integer.parseInt(listInvestimentos.getString(listInvestimentos.getSelectedIndex()).substring(0,
                        listInvestimentos.getString(listInvestimentos.getSelectedIndex()).indexOf(" -"))));
                try {
                    // write pre-action user code here
                    PersistableManager.getInstance().load(investimento, investimento.getId());
                } catch (FloggyException ex) {
                    ex.printStackTrace();
                }
                preencheTelaInvestimento();

                switchDisplayable(null, getFrmCadInvestimento());//GEN-LINE:|7-commandAction|88|309-postAction
            // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|89|245-preAction
        } else if (displayable == listRelatorio) {
            if (command == List.SELECT_COMMAND) {//GEN-END:|7-commandAction|89|245-preAction
                // write pre-action user code here
                listRelatorioAction();//GEN-LINE:|7-commandAction|90|245-postAction
            // write post-action user code here
            } else if (command == cmdExitRelatorio) {//GEN-LINE:|7-commandAction|91|257-preAction
                // write pre-action user code here
                switchDisplayable(null, getPrincipal());//GEN-LINE:|7-commandAction|92|257-postAction
            // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|93|152-preAction
        } else if (displayable == listTipoGastosReceitas) {
            if (command == List.SELECT_COMMAND) {//GEN-END:|7-commandAction|93|152-preAction
                // write pre-action user code here
                listTipoGastosReceitasAction();//GEN-LINE:|7-commandAction|94|152-postAction
            // write post-action user code here
            } else if (command == cmdBackListTipoGRFrmCadTipoGR) {//GEN-LINE:|7-commandAction|95|160-preAction
                // write pre-action user code here
                switchDisplayable(null, getFrmCadTipoGastosReceitas());//GEN-LINE:|7-commandAction|96|160-postAction
            // write post-action user code here
            } else if (command == cmdOKListTipoGR) {//GEN-LINE:|7-commandAction|97|157-preAction
                tipoGR.setId(Integer.parseInt(listTipoGastosReceitas.getString(listTipoGastosReceitas.getSelectedIndex()).substring(0,
                        listTipoGastosReceitas.getString(listGastosReceitas.getSelectedIndex()).indexOf(" -"))));
                try {
                    // write pre-action user code here
                    PersistableManager.getInstance().load(tipoGR, tipoGR.getId());
                    getTxtNomeTipoGR().setString(tipoGR.getNome());
                    if (String.valueOf(tipoGR.getDebitoCredito()).equals("D")) {
                        cgDebitoCredito.setSelectedIndex(0, true);
                    } else {
                        cgDebitoCredito.setSelectedIndex(0, false);
                    }
                } catch (FloggyException ex) {
                    ex.printStackTrace();
                }
                switchDisplayable(null, getFrmCadTipoGastosReceitas());//GEN-LINE:|7-commandAction|98|157-postAction
            // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|99|126-preAction
        } else if (displayable == listUsuario) {
            if (command == List.SELECT_COMMAND) {//GEN-END:|7-commandAction|99|126-preAction
                // write pre-action user code here
                listUsuarioAction();//GEN-LINE:|7-commandAction|100|126-postAction
            // write post-action user code here
            } else if (command == cmdBackListUsuarioCadUsuario) {//GEN-LINE:|7-commandAction|101|132-preAction
                // write pre-action user code here
                switchDisplayable(null, getCadastroUsuario());//GEN-LINE:|7-commandAction|102|132-postAction
            // write post-action user code here
            } else if (command == cmdOKListUsuario) {//GEN-LINE:|7-commandAction|103|179-preAction
                usuario.setId(Integer.parseInt(listUsuario.getString(listUsuario.getSelectedIndex()).substring(0, 1)));
                try {
                    PersistableManager.getInstance().load(usuario, usuario.getId());
                } catch (FloggyException ex) {
                    ex.printStackTrace();
                }
                switchDisplayable(null, getCadastroUsuario());//GEN-LINE:|7-commandAction|104|179-postAction
                getNome().setString(usuario.getNome());
                getLogin().setString(usuario.getLogin());
                getSenha().setString(usuario.getSenha());
            }//GEN-BEGIN:|7-commandAction|105|89-preAction
        } else if (displayable == splashScreen) {
            if (command == SplashScreen.DISMISS_COMMAND) {//GEN-END:|7-commandAction|105|89-preAction
                // write pre-action user code here
                switchDisplayable(null, getTelaLogin());//GEN-LINE:|7-commandAction|106|89-postAction
            // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|107|268-preAction
        } else if (displayable == tbxRelatorio) {
            if (command == cmdOkRelatorio) {//GEN-END:|7-commandAction|107|268-preAction
                // write pre-action user code here
                switchDisplayable(null, getListRelatorio());//GEN-LINE:|7-commandAction|108|268-postAction
            // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|109|7-postCommandAction
        }//GEN-END:|7-commandAction|109|7-postCommandAction
    // write post-action user code here
    }//GEN-BEGIN:|7-commandAction|110|
    //</editor-fold>//GEN-END:|7-commandAction|110|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: CadastroUsuario ">//GEN-BEGIN:|13-getter|0|13-preInit
    /**
     * Returns an initiliazed instance of CadastroUsuario component.
     * @return the initialized component instance
     */
    public Form getCadastroUsuario() {
        if (CadastroUsuario == null) {//GEN-END:|13-getter|0|13-preInit
            // write pre-init user code here
            CadastroUsuario = new Form("Cadastro Usuarios", new Item[] { getNome(), getLogin(), getSenha() });//GEN-BEGIN:|13-getter|1|13-postInit
            CadastroUsuario.addCommand(getCmdListaUsuario());
            CadastroUsuario.addCommand(getCmdOKCadastroUsuario());
            CadastroUsuario.addCommand(getCmdExitCadastroUsuario());
            CadastroUsuario.addCommand(getCmdNovoUsuario());
            CadastroUsuario.addCommand(getCmdDeleteUsuario());
            CadastroUsuario.addCommand(getCmdHelpCadastroUsuario());
            CadastroUsuario.setCommandListener(this);//GEN-END:|13-getter|1|13-postInit
        // write post-init user code here
        }//GEN-BEGIN:|13-getter|2|
        return CadastroUsuario;
    }
    //</editor-fold>//GEN-END:|13-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: nome ">//GEN-BEGIN:|16-getter|0|16-preInit
    /**
     * Returns an initiliazed instance of nome component.
     * @return the initialized component instance
     */
    public TextField getNome() {
        if (nome == null) {//GEN-END:|16-getter|0|16-preInit
            // write pre-init user code here
            nome = new TextField("Nome", null, 32, TextField.ANY);//GEN-LINE:|16-getter|1|16-postInit
        // write post-init user code here
        }//GEN-BEGIN:|16-getter|2|
        return nome;
    }
    //</editor-fold>//GEN-END:|16-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: login ">//GEN-BEGIN:|17-getter|0|17-preInit
    /**
     * Returns an initiliazed instance of login component.
     * @return the initialized component instance
     */
    public TextField getLogin() {
        if (login == null) {//GEN-END:|17-getter|0|17-preInit
            // write pre-init user code here
            login = new TextField("Login", null, 32, TextField.ANY);//GEN-LINE:|17-getter|1|17-postInit
        // write post-init user code here
        }//GEN-BEGIN:|17-getter|2|
        return login;
    }
    //</editor-fold>//GEN-END:|17-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: senha ">//GEN-BEGIN:|18-getter|0|18-preInit
    /**
     * Returns an initiliazed instance of senha component.
     * @return the initialized component instance
     */
    public TextField getSenha() {
        if (senha == null) {//GEN-END:|18-getter|0|18-preInit
            // write pre-init user code here
            senha = new TextField("Senha", null, 32, TextField.ANY | TextField.PASSWORD);//GEN-LINE:|18-getter|1|18-postInit
        // write post-init user code here
        }//GEN-BEGIN:|18-getter|2|
        return senha;
    }
    //</editor-fold>//GEN-END:|18-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: AlertCadastrado ">//GEN-BEGIN:|20-getter|0|20-preInit
    /**
     * Returns an initiliazed instance of AlertCadastrado component.
     * @return the initialized component instance
     */
    public Alert getAlertCadastrado() {
        if (AlertCadastrado == null) {//GEN-END:|20-getter|0|20-preInit
            // write pre-init user code here
            AlertCadastrado = new Alert("Sucesso!", "Usuario Salvo!", null, AlertType.INFO);//GEN-BEGIN:|20-getter|1|20-postInit
            AlertCadastrado.setTimeout(Alert.FOREVER);//GEN-END:|20-getter|1|20-postInit
        // write post-init user code here
        }//GEN-BEGIN:|20-getter|2|
        return AlertCadastrado;
    }
    //</editor-fold>//GEN-END:|20-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdOKCadastroUsuario ">//GEN-BEGIN:|21-getter|0|21-preInit
    /**
     * Returns an initiliazed instance of cmdOKCadastroUsuario component.
     * @return the initialized component instance
     */
    public Command getCmdOKCadastroUsuario() {
        if (cmdOKCadastroUsuario == null) {//GEN-END:|21-getter|0|21-preInit
            // write pre-init user code here
            cmdOKCadastroUsuario = new Command("Salvar", Command.OK, 0);//GEN-LINE:|21-getter|1|21-postInit
        // write post-init user code here
        }//GEN-BEGIN:|21-getter|2|
        return cmdOKCadastroUsuario;
    }
    //</editor-fold>//GEN-END:|21-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdExitCadastroUsuario ">//GEN-BEGIN:|24-getter|0|24-preInit
    /**
     * Returns an initiliazed instance of cmdExitCadastroUsuario component.
     * @return the initialized component instance
     */
    public Command getCmdExitCadastroUsuario() {
        if (cmdExitCadastroUsuario == null) {//GEN-END:|24-getter|0|24-preInit
            // write pre-init user code here
            cmdExitCadastroUsuario = new Command("Exit", Command.EXIT, 0);//GEN-LINE:|24-getter|1|24-postInit
        // write post-init user code here
        }//GEN-BEGIN:|24-getter|2|
        return cmdExitCadastroUsuario;
    }
    //</editor-fold>//GEN-END:|24-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: ComofazerumCadastro ">//GEN-BEGIN:|36-getter|0|36-preInit
    /**
     * Returns an initiliazed instance of ComofazerumCadastro component.
     * @return the initialized component instance
     */
    public TextBox getComofazerumCadastro() {
        if (ComofazerumCadastro == null) {//GEN-END:|36-getter|0|36-preInit
            // write pre-init user code here
            ComofazerumCadastro = new TextBox("Como fazer um cadastro", "Coloque seu nome, um login para \nidentifica\u00E7\u00E3o no sistema e uma \nsenha para seguran\u00E7a.", 100, TextField.ANY);//GEN-BEGIN:|36-getter|1|36-postInit
            ComofazerumCadastro.addCommand(getCmdExitHelpCadUsuario());
            ComofazerumCadastro.setCommandListener(this);//GEN-END:|36-getter|1|36-postInit
        // write post-init user code here
        }//GEN-BEGIN:|36-getter|2|
        return ComofazerumCadastro;
    }
    //</editor-fold>//GEN-END:|36-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdHelpCadastroUsuario ">//GEN-BEGIN:|30-getter|0|30-preInit
    /**
     * Returns an initiliazed instance of cmdHelpCadastroUsuario component.
     * @return the initialized component instance
     */
    public Command getCmdHelpCadastroUsuario() {
        if (cmdHelpCadastroUsuario == null) {//GEN-END:|30-getter|0|30-preInit
            // write pre-init user code here
            cmdHelpCadastroUsuario = new Command("Help", Command.HELP, 0);//GEN-LINE:|30-getter|1|30-postInit
        // write post-init user code here
        }//GEN-BEGIN:|30-getter|2|
        return cmdHelpCadastroUsuario;
    }
    //</editor-fold>//GEN-END:|30-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdExitHelpCadUsuario ">//GEN-BEGIN:|38-getter|0|38-preInit
    /**
     * Returns an initiliazed instance of cmdExitHelpCadUsuario component.
     * @return the initialized component instance
     */
    public Command getCmdExitHelpCadUsuario() {
        if (cmdExitHelpCadUsuario == null) {//GEN-END:|38-getter|0|38-preInit
            // write pre-init user code here
            cmdExitHelpCadUsuario = new Command("Exit", Command.EXIT, 0);//GEN-LINE:|38-getter|1|38-postInit
        // write post-init user code here
        }//GEN-BEGIN:|38-getter|2|
        return cmdExitHelpCadUsuario;
    }
    //</editor-fold>//GEN-END:|38-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: Principal ">//GEN-BEGIN:|46-getter|0|46-preInit
    /**
     * Returns an initiliazed instance of Principal component.
     * @return the initialized component instance
     */
    public List getPrincipal() {
        if (Principal == null) {//GEN-END:|46-getter|0|46-preInit
            // write pre-init user code here
            Principal = new List("Principal", Choice.IMPLICIT);//GEN-BEGIN:|46-getter|1|46-postInit
            Principal.append("Login no sistema como outro usuario", null);
            Principal.append("Cadastro de usu\u00E1rios", null);
            Principal.append("Cadastro de Tipos de Receitas/Gastos", null);
            Principal.append("Cadastro de Receitas/Gastos", null);
            Principal.append("Cadastro de Emprestimos", null);
            Principal.append("Cadastro de Investimentos", null);
            Principal.append("Relatorios", null);
            Principal.addCommand(getCmdExitPrincipal());
            Principal.setCommandListener(this);
            Principal.setSelectedFlags(new boolean[] { false, false, false, false, false, false, false });//GEN-END:|46-getter|1|46-postInit
        // write post-init user code here
        }//GEN-BEGIN:|46-getter|2|
        return Principal;
    }
    //</editor-fold>//GEN-END:|46-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: PrincipalAction ">//GEN-BEGIN:|46-action|0|46-preAction
    /**
     * Performs an action assigned to the selected list element in the Principal component.
     */
    public void PrincipalAction() {//GEN-END:|46-action|0|46-preAction
        // enter pre-action user code here
        String __selectedString = getPrincipal().getString(getPrincipal().getSelectedIndex());//GEN-BEGIN:|46-action|1|50-preAction
        if (__selectedString != null) {
            if (__selectedString.equals("Login no sistema como outro usuario")) {//GEN-END:|46-action|1|50-preAction
                // write pre-action user code here
                switchDisplayable(null, getTelaLogin());//GEN-LINE:|46-action|2|50-postAction
            // write post-action user code here
            } else if (__selectedString.equals("Cadastro de usu\u00E1rios")) {//GEN-LINE:|46-action|3|51-preAction
                // write pre-action user code here
                switchDisplayable(null, getCadastroUsuario());//GEN-LINE:|46-action|4|51-postAction
            // write post-action user code here
            } else if (__selectedString.equals("Cadastro de Tipos de Receitas/Gastos")) {//GEN-LINE:|46-action|5|53-preAction
                // write pre-action user code here
                switchDisplayable(null, getFrmCadTipoGastosReceitas());//GEN-LINE:|46-action|6|53-postAction
            // write post-action user code here
            } else if (__selectedString.equals("Cadastro de Receitas/Gastos")) {//GEN-LINE:|46-action|7|52-preAction
                // write pre-action user code here
                switchDisplayable(null, getFrmCadGastosReceitas());//GEN-LINE:|46-action|8|52-postAction
            // write post-action user code here
            } else if (__selectedString.equals("Cadastro de Emprestimos")) {//GEN-LINE:|46-action|9|55-preAction
                // write pre-action user code here
                switchDisplayable(null, getFrmCadGastosReceitas());//GEN-LINE:|46-action|10|55-postAction
                // write post-action user code here
                frmCadGastosReceitas.append(getTxtNumParcelasGR());
                frmCadGastosReceitas.append(getTxtQuantDiasGR());
            } else if (__selectedString.equals("Cadastro de Investimentos")) {//GEN-LINE:|46-action|11|228-preAction
                // write pre-action user code here
                switchDisplayable(null, getFrmCadInvestimento());//GEN-LINE:|46-action|12|228-postAction
            // write post-action user code here
            } else if (__selectedString.equals("Relatorios")) {//GEN-LINE:|46-action|13|251-preAction
                // write pre-action user code here
                switchDisplayable(null, getListRelatorio());//GEN-LINE:|46-action|14|251-postAction
            // write post-action user code here
            }//GEN-BEGIN:|46-action|15|46-postAction
        }//GEN-END:|46-action|15|46-postAction
// enter post-action user code here
    }//GEN-BEGIN:|46-action|16|
    //</editor-fold>//GEN-END:|46-action|16|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdExitPrincipal ">//GEN-BEGIN:|58-getter|0|58-preInit
    /**
     * Returns an initiliazed instance of cmdExitPrincipal component.
     * @return the initialized component instance
     */
    public Command getCmdExitPrincipal() {
        if (cmdExitPrincipal == null) {//GEN-END:|58-getter|0|58-preInit
            // write pre-init user code here
            cmdExitPrincipal = new Command("Exit", Command.EXIT, 0);//GEN-LINE:|58-getter|1|58-postInit
        // write post-init user code here
        }//GEN-BEGIN:|58-getter|2|
        return cmdExitPrincipal;
    }
    //</editor-fold>//GEN-END:|58-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: TelaLogin ">//GEN-BEGIN:|66-getter|0|66-preInit
    /**
     * Returns an initiliazed instance of TelaLogin component.
     * @return the initialized component instance
     */
    public Form getTelaLogin() {
        if (TelaLogin == null) {//GEN-END:|66-getter|0|66-preInit
            // write pre-init user code here
            TelaLogin = new Form("Login", new Item[] { getTxtLoginLogin(), getTxtSenhaLogin() });//GEN-BEGIN:|66-getter|1|66-postInit
            TelaLogin.addCommand(getCmdOKLogin());
            TelaLogin.addCommand(getCmdExitLogin());
            TelaLogin.addCommand(getCmdScreenLoginCadUsuario());
            TelaLogin.setCommandListener(this);//GEN-END:|66-getter|1|66-postInit
        // write post-init user code here
        }//GEN-BEGIN:|66-getter|2|
        return TelaLogin;
    }
    //</editor-fold>//GEN-END:|66-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: txtLoginLogin ">//GEN-BEGIN:|68-getter|0|68-preInit
    /**
     * Returns an initiliazed instance of txtLoginLogin component.
     * @return the initialized component instance
     */
    public TextField getTxtLoginLogin() {
        if (txtLoginLogin == null) {//GEN-END:|68-getter|0|68-preInit
            // write pre-init user code here
            txtLoginLogin = new TextField("Login", null, 32, TextField.ANY);//GEN-LINE:|68-getter|1|68-postInit
        // write post-init user code here
        }//GEN-BEGIN:|68-getter|2|
        return txtLoginLogin;
    }
    //</editor-fold>//GEN-END:|68-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: txtSenhaLogin ">//GEN-BEGIN:|69-getter|0|69-preInit
    /**
     * Returns an initiliazed instance of txtSenhaLogin component.
     * @return the initialized component instance
     */
    public TextField getTxtSenhaLogin() {
        if (txtSenhaLogin == null) {//GEN-END:|69-getter|0|69-preInit
            // write pre-init user code here
            txtSenhaLogin = new TextField("Senha", null, 32, TextField.ANY | TextField.PASSWORD);//GEN-LINE:|69-getter|1|69-postInit
        // write post-init user code here
        }//GEN-BEGIN:|69-getter|2|
        return txtSenhaLogin;
    }
    //</editor-fold>//GEN-END:|69-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdOKLogin ">//GEN-BEGIN:|76-getter|0|76-preInit
    /**
     * Returns an initiliazed instance of cmdOKLogin component.
     * @return the initialized component instance
     */
    public Command getCmdOKLogin() {
        if (cmdOKLogin == null) {//GEN-END:|76-getter|0|76-preInit
            // write pre-init user code here
            cmdOKLogin = new Command("Ok", Command.OK, 0);//GEN-LINE:|76-getter|1|76-postInit
        // write post-init user code here
        }//GEN-BEGIN:|76-getter|2|
        return cmdOKLogin;
    }
    //</editor-fold>//GEN-END:|76-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdExitLogin ">//GEN-BEGIN:|78-getter|0|78-preInit
    /**
     * Returns an initiliazed instance of cmdExitLogin component.
     * @return the initialized component instance
     */
    public Command getCmdExitLogin() {
        if (cmdExitLogin == null) {//GEN-END:|78-getter|0|78-preInit
            // write pre-init user code here
            cmdExitLogin = new Command("Exit", Command.EXIT, 0);//GEN-LINE:|78-getter|1|78-postInit
        // write post-init user code here
        }//GEN-BEGIN:|78-getter|2|
        return cmdExitLogin;
    }
    //</editor-fold>//GEN-END:|78-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: splashScreen ">//GEN-BEGIN:|88-getter|0|88-preInit
    /**
     * Returns an initiliazed instance of splashScreen component.
     * @return the initialized component instance
     */
    public SplashScreen getSplashScreen() {
        if (splashScreen == null) {//GEN-END:|88-getter|0|88-preInit
            // write pre-init user code here
            splashScreen = new SplashScreen(getDisplay());//GEN-BEGIN:|88-getter|1|88-postInit
            splashScreen.setTitle("splashScreen");
            splashScreen.setCommandListener(this);
            splashScreen.setFullScreenMode(true);
            splashScreen.setImage(getImage1());
            splashScreen.setText("Bem Vindo!");//GEN-END:|88-getter|1|88-postInit
        // write post-init user code here
        }//GEN-BEGIN:|88-getter|2|
        return splashScreen;
    }
    //</editor-fold>//GEN-END:|88-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: commandAction for Items ">//GEN-BEGIN:|8-itemCommandAction|0|8-preItemCommandAction
    /**
     * Called by a system to indicated that a command has been invoked on a particular item.
     * @param command the Command that was invoked
     * @param displayable the Item where the command was invoked
     */
    public void commandAction(Command command, Item item) {//GEN-END:|8-itemCommandAction|0|8-preItemCommandAction
        // write pre-action user code here
        if (item == cgTipoGR) {//GEN-BEGIN:|8-itemCommandAction|1|117-preAction
            if (command == cmdScreenListaTiposGR) {//GEN-END:|8-itemCommandAction|1|117-preAction
                ObjectSet os = null;
                TiposGastosReceitas tipoGRaux = new TiposGastosReceitas();
                getListGastosReceitasTiposGR().deleteAll();
                try {
                    os = fu.findComparator(tipoGRaux, new TipoGRNomeComparator());
                    for (int i = 0; i < os.size(); i++) {
                        tipoGRaux = (TiposGastosReceitas) os.get(i);
                        getListGastosReceitasTiposGR().append(tipoGRaux.getId() + " - " + tipoGRaux.getNome() + " - " +
                                tipoGRaux.getDebitoCredito() + "\n", null);
                    }
                } catch (FloggyException ex) {
                    ex.printStackTrace();
                }
                switchDisplayable(null, getListGastosReceitasTiposGR());//GEN-LINE:|8-itemCommandAction|2|117-postAction
            // write post-action user code here
            }//GEN-BEGIN:|8-itemCommandAction|3|8-postItemCommandAction
        }//GEN-END:|8-itemCommandAction|3|8-postItemCommandAction
    // write post-action user code here
    }//GEN-BEGIN:|8-itemCommandAction|4|
    //</editor-fold>//GEN-END:|8-itemCommandAction|4|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: frmCadGastosReceitas ">//GEN-BEGIN:|91-getter|0|91-preInit
    /**
     * Returns an initiliazed instance of frmCadGastosReceitas component.
     * @return the initialized component instance
     */
    public Form getFrmCadGastosReceitas() {
        if (frmCadGastosReceitas == null) {//GEN-END:|91-getter|0|91-preInit
            // write pre-init user code here
            frmCadGastosReceitas = new Form("Cadstro de Gastos/Receitas", new Item[] { getCgTipoGR(), getTxtNomeGR(), getTxtDescricaoGR(), getTxtValorGR(), getDfDataEmissaoGR(), getDfDataVencimentoGR(), getDfDataPagamentoGR(), getCgCompensadoGR() });//GEN-BEGIN:|91-getter|1|91-postInit
            frmCadGastosReceitas.addCommand(getCmdOKCadGR());
            frmCadGastosReceitas.addCommand(getCmdCancelGastosReceitas());
            frmCadGastosReceitas.addCommand(getCmdScreenGastosReceitas());
            frmCadGastosReceitas.addCommand(getCmdNovoCadGR());
            frmCadGastosReceitas.addCommand(getCmdDeleteGR());
            frmCadGastosReceitas.addCommand(getCmdExitCadGR());
            frmCadGastosReceitas.setCommandListener(this);//GEN-END:|91-getter|1|91-postInit
        // write post-init user code here
        }//GEN-BEGIN:|91-getter|2|
        return frmCadGastosReceitas;
    }
    //</editor-fold>//GEN-END:|91-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cgTipoGR ">//GEN-BEGIN:|102-getter|0|102-preInit
    /**
     * Returns an initiliazed instance of cgTipoGR component.
     * @return the initialized component instance
     */
    public ChoiceGroup getCgTipoGR() {
        if (cgTipoGR == null) {//GEN-END:|102-getter|0|102-preInit
            // write pre-init user code here
            cgTipoGR = new ChoiceGroup("Tipos de Gasto e Receitas:", Choice.EXCLUSIVE);//GEN-BEGIN:|102-getter|1|102-postInit
            cgTipoGR.addCommand(getCmdScreenListaTiposGR());
            cgTipoGR.setItemCommandListener(this);
            cgTipoGR.setDefaultCommand(getCmdScreenListaTiposGR());//GEN-END:|102-getter|1|102-postInit
        // write post-init user code here
        }//GEN-BEGIN:|102-getter|2|
        return cgTipoGR;
    }
    //</editor-fold>//GEN-END:|102-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: txtNomeGR ">//GEN-BEGIN:|103-getter|0|103-preInit
    /**
     * Returns an initiliazed instance of txtNomeGR component.
     * @return the initialized component instance
     */
    public TextField getTxtNomeGR() {
        if (txtNomeGR == null) {//GEN-END:|103-getter|0|103-preInit
            // write pre-init user code here
            txtNomeGR = new TextField("Nome:", null, 15, TextField.ANY);//GEN-LINE:|103-getter|1|103-postInit
        // write post-init user code here
        }//GEN-BEGIN:|103-getter|2|
        return txtNomeGR;
    }
    //</editor-fold>//GEN-END:|103-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: txtDescricaoGR ">//GEN-BEGIN:|104-getter|0|104-preInit
    /**
     * Returns an initiliazed instance of txtDescricaoGR component.
     * @return the initialized component instance
     */
    public TextField getTxtDescricaoGR() {
        if (txtDescricaoGR == null) {//GEN-END:|104-getter|0|104-preInit
            // write pre-init user code here
            txtDescricaoGR = new TextField("Descri\u00E7\u00E3o:", null, 64, TextField.ANY);//GEN-LINE:|104-getter|1|104-postInit
        // write post-init user code here
        }//GEN-BEGIN:|104-getter|2|
        return txtDescricaoGR;
    }
    //</editor-fold>//GEN-END:|104-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: txtValorGR ">//GEN-BEGIN:|105-getter|0|105-preInit
    /**
     * Returns an initiliazed instance of txtValorGR component.
     * @return the initialized component instance
     */
    public TextField getTxtValorGR() {
        if (txtValorGR == null) {//GEN-END:|105-getter|0|105-preInit
            // write pre-init user code here
            txtValorGR = new TextField("Valor:", null, 32, TextField.DECIMAL);//GEN-LINE:|105-getter|1|105-postInit
        // write post-init user code here
        }//GEN-BEGIN:|105-getter|2|
        return txtValorGR;
    }
    //</editor-fold>//GEN-END:|105-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: dfDataEmissaoGR ">//GEN-BEGIN:|106-getter|0|106-preInit
    /**
     * Returns an initiliazed instance of dfDataEmissaoGR component.
     * @return the initialized component instance
     */
    public DateField getDfDataEmissaoGR() {
        if (dfDataEmissaoGR == null) {//GEN-END:|106-getter|0|106-preInit
            // write pre-init user code here
            dfDataEmissaoGR = new DateField("Data Emiss\u00E3o:", DateField.DATE);//GEN-BEGIN:|106-getter|1|106-postInit
            dfDataEmissaoGR.setDate(new java.util.Date(System.currentTimeMillis()));//GEN-END:|106-getter|1|106-postInit
        // write post-init user code here
        }//GEN-BEGIN:|106-getter|2|
        return dfDataEmissaoGR;
    }
    //</editor-fold>//GEN-END:|106-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: dfDataVencimentoGR ">//GEN-BEGIN:|107-getter|0|107-preInit
    /**
     * Returns an initiliazed instance of dfDataVencimentoGR component.
     * @return the initialized component instance
     */
    public DateField getDfDataVencimentoGR() {
        if (dfDataVencimentoGR == null) {//GEN-END:|107-getter|0|107-preInit
            // write pre-init user code here
            dfDataVencimentoGR = new DateField("Data Vencimento:", DateField.DATE);//GEN-BEGIN:|107-getter|1|107-postInit
            dfDataVencimentoGR.setDate(new java.util.Date(System.currentTimeMillis()));//GEN-END:|107-getter|1|107-postInit
        // write post-init user code here
        }//GEN-BEGIN:|107-getter|2|
        return dfDataVencimentoGR;
    }
    //</editor-fold>//GEN-END:|107-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: dfDataPagamentoGR ">//GEN-BEGIN:|108-getter|0|108-preInit
    /**
     * Returns an initiliazed instance of dfDataPagamentoGR component.
     * @return the initialized component instance
     */
    public DateField getDfDataPagamentoGR() {
        if (dfDataPagamentoGR == null) {//GEN-END:|108-getter|0|108-preInit
            // write pre-init user code here
            dfDataPagamentoGR = new DateField("Data Pagamento:", DateField.DATE);//GEN-BEGIN:|108-getter|1|108-postInit
            dfDataPagamentoGR.setDate(new java.util.Date(System.currentTimeMillis()));//GEN-END:|108-getter|1|108-postInit
        // write post-init user code here
        }//GEN-BEGIN:|108-getter|2|
        return dfDataPagamentoGR;
    }
    //</editor-fold>//GEN-END:|108-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cgCompensadoGR ">//GEN-BEGIN:|109-getter|0|109-preInit
    /**
     * Returns an initiliazed instance of cgCompensadoGR component.
     * @return the initialized component instance
     */
    public ChoiceGroup getCgCompensadoGR() {
        if (cgCompensadoGR == null) {//GEN-END:|109-getter|0|109-preInit
            // write pre-init user code here
            cgCompensadoGR = new ChoiceGroup("Compensado:", Choice.MULTIPLE);//GEN-BEGIN:|109-getter|1|109-postInit
            cgCompensadoGR.append("", null);
            cgCompensadoGR.setSelectedFlags(new boolean[] { false });
            cgCompensadoGR.setFont(0, null);//GEN-END:|109-getter|1|109-postInit
        // write post-init user code here
        }//GEN-BEGIN:|109-getter|2|
        return cgCompensadoGR;
    }
    //</editor-fold>//GEN-END:|109-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdExitCadGR ">//GEN-BEGIN:|94-getter|0|94-preInit
    /**
     * Returns an initiliazed instance of cmdExitCadGR component.
     * @return the initialized component instance
     */
    public Command getCmdExitCadGR() {
        if (cmdExitCadGR == null) {//GEN-END:|94-getter|0|94-preInit
            // write pre-init user code here
            cmdExitCadGR = new Command("Exit", Command.EXIT, 0);//GEN-LINE:|94-getter|1|94-postInit
        // write post-init user code here
        }//GEN-BEGIN:|94-getter|2|
        return cmdExitCadGR;
    }
    //</editor-fold>//GEN-END:|94-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdNovoCadGR ">//GEN-BEGIN:|96-getter|0|96-preInit
    /**
     * Returns an initiliazed instance of cmdNovoCadGR component.
     * @return the initialized component instance
     */
    public Command getCmdNovoCadGR() {
        if (cmdNovoCadGR == null) {//GEN-END:|96-getter|0|96-preInit
            // write pre-init user code here
            cmdNovoCadGR = new Command("Novo", Command.OK, 0);//GEN-LINE:|96-getter|1|96-postInit
        // write post-init user code here
        }//GEN-BEGIN:|96-getter|2|
        return cmdNovoCadGR;
    }
    //</editor-fold>//GEN-END:|96-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdOKCadGR ">//GEN-BEGIN:|98-getter|0|98-preInit
    /**
     * Returns an initiliazed instance of cmdOKCadGR component.
     * @return the initialized component instance
     */
    public Command getCmdOKCadGR() {
        if (cmdOKCadGR == null) {//GEN-END:|98-getter|0|98-preInit
            // write pre-init user code here
            cmdOKCadGR = new Command("Salvar", Command.OK, 0);//GEN-LINE:|98-getter|1|98-postInit
        // write post-init user code here
        }//GEN-BEGIN:|98-getter|2|
        return cmdOKCadGR;
    }
    //</editor-fold>//GEN-END:|98-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdScreenListaTiposGR ">//GEN-BEGIN:|110-getter|0|110-preInit
    /**
     * Returns an initiliazed instance of cmdScreenListaTiposGR component.
     * @return the initialized component instance
     */
    public Command getCmdScreenListaTiposGR() {
        if (cmdScreenListaTiposGR == null) {//GEN-END:|110-getter|0|110-preInit
            // write pre-init user code here
            cmdScreenListaTiposGR = new Command("Listas de Tipos Gastos e Receitas", Command.SCREEN, 0);//GEN-LINE:|110-getter|1|110-postInit
        // write post-init user code here
        }//GEN-BEGIN:|110-getter|2|
        return cmdScreenListaTiposGR;
    }
    //</editor-fold>//GEN-END:|110-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: tickerListTipos_GastoReceitas ">//GEN-BEGIN:|124-getter|0|124-preInit
    /**
     * Returns an initiliazed instance of tickerListTipos_GastoReceitas component.
     * @return the initialized component instance
     */
    public Ticker getTickerListTipos_GastoReceitas() {
        if (tickerListTipos_GastoReceitas == null) {//GEN-END:|124-getter|0|124-preInit
            // write pre-init user code here
            tickerListTipos_GastoReceitas = new Ticker("Excolha o Tipos de Gasto/Receita para Cadastrar/Alterar um Gasto/Receita");//GEN-LINE:|124-getter|1|124-postInit
        // write post-init user code here
        }//GEN-BEGIN:|124-getter|2|
        return tickerListTipos_GastoReceitas;
    }
    //</editor-fold>//GEN-END:|124-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: listUsuario ">//GEN-BEGIN:|125-getter|0|125-preInit
    /**
     * Returns an initiliazed instance of listUsuario component.
     * @return the initialized component instance
     */
    public List getListUsuario() {
        if (listUsuario == null) {//GEN-END:|125-getter|0|125-preInit
            // write pre-init user code here
            listUsuario = new List("list", Choice.EXCLUSIVE);//GEN-BEGIN:|125-getter|1|125-postInit
            listUsuario.addCommand(getCmdOKListUsuario());
            listUsuario.addCommand(getCmdBackListUsuarioCadUsuario());
            listUsuario.setCommandListener(this);//GEN-END:|125-getter|1|125-postInit
        // write post-init user code here
        }//GEN-BEGIN:|125-getter|2|
        return listUsuario;
    }
    //</editor-fold>//GEN-END:|125-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: listUsuarioAction ">//GEN-BEGIN:|125-action|0|125-preAction
    /**
     * Performs an action assigned to the selected list element in the listUsuario component.
     */
    public void listUsuarioAction() {//GEN-END:|125-action|0|125-preAction
        // enter pre-action user code here
        String __selectedString = getListUsuario().getString(getListUsuario().getSelectedIndex());//GEN-LINE:|125-action|1|125-postAction
    // enter post-action user code here
    }//GEN-BEGIN:|125-action|2|
    //</editor-fold>//GEN-END:|125-action|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdListaUsuario ">//GEN-BEGIN:|128-getter|0|128-preInit
    /**
     * Returns an initiliazed instance of cmdListaUsuario component.
     * @return the initialized component instance
     */
    public Command getCmdListaUsuario() {
        if (cmdListaUsuario == null) {//GEN-END:|128-getter|0|128-preInit
            // write pre-init user code here
            cmdListaUsuario = new Command("Item", Command.ITEM, 0);//GEN-LINE:|128-getter|1|128-postInit
        // write post-init user code here
        }//GEN-BEGIN:|128-getter|2|
        return cmdListaUsuario;
    }
    //</editor-fold>//GEN-END:|128-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdBackListUsuarioCadUsuario ">//GEN-BEGIN:|131-getter|0|131-preInit
    /**
     * Returns an initiliazed instance of cmdBackListUsuarioCadUsuario component.
     * @return the initialized component instance
     */
    public Command getCmdBackListUsuarioCadUsuario() {
        if (cmdBackListUsuarioCadUsuario == null) {//GEN-END:|131-getter|0|131-preInit
            // write pre-init user code here
            cmdBackListUsuarioCadUsuario = new Command("Back", Command.BACK, 0);//GEN-LINE:|131-getter|1|131-postInit
        // write post-init user code here
        }//GEN-BEGIN:|131-getter|2|
        return cmdBackListUsuarioCadUsuario;
    }
    //</editor-fold>//GEN-END:|131-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: frmCadTipoGastosReceitas ">//GEN-BEGIN:|134-getter|0|134-preInit
    /**
     * Returns an initiliazed instance of frmCadTipoGastosReceitas component.
     * @return the initialized component instance
     */
    public Form getFrmCadTipoGastosReceitas() {
        if (frmCadTipoGastosReceitas == null) {//GEN-END:|134-getter|0|134-preInit
            // write pre-init user code here
            frmCadTipoGastosReceitas = new Form("Tipos de Gastor e Receitas", new Item[] { getTxtNomeTipoGR(), getCgDebitoCredito() });//GEN-BEGIN:|134-getter|1|134-postInit
            frmCadTipoGastosReceitas.setTicker(getTicker());
            frmCadTipoGastosReceitas.addCommand(getCmdOKTipoGR());
            frmCadTipoGastosReceitas.addCommand(getCmdCancelTiposGr());
            frmCadTipoGastosReceitas.addCommand(getCmdExitTipoGRPrincipal());
            frmCadTipoGastosReceitas.addCommand(getCmdListTipoGR());
            frmCadTipoGastosReceitas.addCommand(getCmdNovoTipoGR());
            frmCadTipoGastosReceitas.addCommand(getCmdDeleteTipoGR());
            frmCadTipoGastosReceitas.setCommandListener(this);//GEN-END:|134-getter|1|134-postInit
        // write post-init user code here
        }//GEN-BEGIN:|134-getter|2|
        return frmCadTipoGastosReceitas;
    }
    //</editor-fold>//GEN-END:|134-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cgDebitoCredito ">//GEN-BEGIN:|138-getter|0|138-preInit
    /**
     * Returns an initiliazed instance of cgDebitoCredito component.
     * @return the initialized component instance
     */
    public ChoiceGroup getCgDebitoCredito() {
        if (cgDebitoCredito == null) {//GEN-END:|138-getter|0|138-preInit
            // write pre-init user code here
            cgDebitoCredito = new ChoiceGroup("Tipo", Choice.EXCLUSIVE);//GEN-BEGIN:|138-getter|1|138-postInit
            cgDebitoCredito.append("D\u00E9bito", null);
            cgDebitoCredito.append("Cr\u00E9dito", null);
            cgDebitoCredito.setSelectedFlags(new boolean[] { true, false });
            cgDebitoCredito.setFont(0, null);
            cgDebitoCredito.setFont(1, null);//GEN-END:|138-getter|1|138-postInit
        // write post-init user code here
        }//GEN-BEGIN:|138-getter|2|
        return cgDebitoCredito;
    }
    //</editor-fold>//GEN-END:|138-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: ticker ">//GEN-BEGIN:|135-getter|0|135-preInit
    /**
     * Returns an initiliazed instance of ticker component.
     * @return the initialized component instance
     */
    public Ticker getTicker() {
        if (ticker == null) {//GEN-END:|135-getter|0|135-preInit
            // write pre-init user code here
            ticker = new Ticker("Cadastro de Tipos de Gastos e Receitas");//GEN-LINE:|135-getter|1|135-postInit
        // write post-init user code here
        }//GEN-BEGIN:|135-getter|2|
        return ticker;
    }
    //</editor-fold>//GEN-END:|135-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: alertTipoGRCadastro ">//GEN-BEGIN:|149-getter|0|149-preInit
    /**
     * Returns an initiliazed instance of alertTipoGRCadastro component.
     * @return the initialized component instance
     */
    public Alert getAlertTipoGRCadastro() {
        if (alertTipoGRCadastro == null) {//GEN-END:|149-getter|0|149-preInit
            // write pre-init user code here
            alertTipoGRCadastro = new Alert("Sucesso!", "Tipo de Gasto/Receita Salvo!", null, AlertType.INFO);//GEN-BEGIN:|149-getter|1|149-postInit
            alertTipoGRCadastro.setTimeout(Alert.FOREVER);//GEN-END:|149-getter|1|149-postInit
        // write post-init user code here
        }//GEN-BEGIN:|149-getter|2|
        return alertTipoGRCadastro;
    }
    //</editor-fold>//GEN-END:|149-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdExitTipoGRPrincipal ">//GEN-BEGIN:|142-getter|0|142-preInit
    /**
     * Returns an initiliazed instance of cmdExitTipoGRPrincipal component.
     * @return the initialized component instance
     */
    public Command getCmdExitTipoGRPrincipal() {
        if (cmdExitTipoGRPrincipal == null) {//GEN-END:|142-getter|0|142-preInit
            // write pre-init user code here
            cmdExitTipoGRPrincipal = new Command("Exit", Command.EXIT, 0);//GEN-LINE:|142-getter|1|142-postInit
        // write post-init user code here
        }//GEN-BEGIN:|142-getter|2|
        return cmdExitTipoGRPrincipal;
    }
    //</editor-fold>//GEN-END:|142-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdOKTipoGR ">//GEN-BEGIN:|145-getter|0|145-preInit
    /**
     * Returns an initiliazed instance of cmdOKTipoGR component.
     * @return the initialized component instance
     */
    public Command getCmdOKTipoGR() {
        if (cmdOKTipoGR == null) {//GEN-END:|145-getter|0|145-preInit
            // write pre-init user code here
            cmdOKTipoGR = new Command("Salvar", Command.OK, 0);//GEN-LINE:|145-getter|1|145-postInit
        // write post-init user code here
        }//GEN-BEGIN:|145-getter|2|
        return cmdOKTipoGR;
    }
    //</editor-fold>//GEN-END:|145-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdListTipoGR ">//GEN-BEGIN:|147-getter|0|147-preInit
    /**
     * Returns an initiliazed instance of cmdListTipoGR component.
     * @return the initialized component instance
     */
    public Command getCmdListTipoGR() {
        if (cmdListTipoGR == null) {//GEN-END:|147-getter|0|147-preInit
            // write pre-init user code here
            cmdListTipoGR = new Command("Item", Command.ITEM, 0);//GEN-LINE:|147-getter|1|147-postInit
        // write post-init user code here
        }//GEN-BEGIN:|147-getter|2|
        return cmdListTipoGR;
    }
    //</editor-fold>//GEN-END:|147-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: listTipoGastosReceitas ">//GEN-BEGIN:|151-getter|0|151-preInit
    /**
     * Returns an initiliazed instance of listTipoGastosReceitas component.
     * @return the initialized component instance
     */
    public List getListTipoGastosReceitas() {
        if (listTipoGastosReceitas == null) {//GEN-END:|151-getter|0|151-preInit
            // write pre-init user code here
            listTipoGastosReceitas = new List("Tipos de Gastos e Receitas", Choice.EXCLUSIVE);//GEN-BEGIN:|151-getter|1|151-postInit
            listTipoGastosReceitas.setTicker(getTickerListTipos_GastoReceitas());
            listTipoGastosReceitas.addCommand(getCmdOKListTipoGR());
            listTipoGastosReceitas.addCommand(getCmdBackListTipoGRFrmCadTipoGR());
            listTipoGastosReceitas.setCommandListener(this);//GEN-END:|151-getter|1|151-postInit
        // write post-init user code here
        }//GEN-BEGIN:|151-getter|2|
        return listTipoGastosReceitas;
    }
    //</editor-fold>//GEN-END:|151-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: listTipoGastosReceitasAction ">//GEN-BEGIN:|151-action|0|151-preAction
    /**
     * Performs an action assigned to the selected list element in the listTipoGastosReceitas component.
     */
    public void listTipoGastosReceitasAction() {//GEN-END:|151-action|0|151-preAction
        // enter pre-action user code here
        String __selectedString = getListTipoGastosReceitas().getString(getListTipoGastosReceitas().getSelectedIndex());//GEN-LINE:|151-action|1|151-postAction
// enter post-action user code here
    }//GEN-BEGIN:|151-action|2|
    //</editor-fold>//GEN-END:|151-action|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdOKListTipoGR ">//GEN-BEGIN:|156-getter|0|156-preInit
    /**
     * Returns an initiliazed instance of cmdOKListTipoGR component.
     * @return the initialized component instance
     */
    public Command getCmdOKListTipoGR() {
        if (cmdOKListTipoGR == null) {//GEN-END:|156-getter|0|156-preInit
            // write pre-init user code here
            cmdOKListTipoGR = new Command("Ok", Command.OK, 0);//GEN-LINE:|156-getter|1|156-postInit
        // write post-init user code here
        }//GEN-BEGIN:|156-getter|2|
        return cmdOKListTipoGR;
    }
    //</editor-fold>//GEN-END:|156-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdBackListTipoGRFrmCadTipoGR ">//GEN-BEGIN:|159-getter|0|159-preInit
    /**
     * Returns an initiliazed instance of cmdBackListTipoGRFrmCadTipoGR component.
     * @return the initialized component instance
     */
    public Command getCmdBackListTipoGRFrmCadTipoGR() {
        if (cmdBackListTipoGRFrmCadTipoGR == null) {//GEN-END:|159-getter|0|159-preInit
            // write pre-init user code here
            cmdBackListTipoGRFrmCadTipoGR = new Command("Back", Command.BACK, 0);//GEN-LINE:|159-getter|1|159-postInit
        // write post-init user code here
        }//GEN-BEGIN:|159-getter|2|
        return cmdBackListTipoGRFrmCadTipoGR;
    }
    //</editor-fold>//GEN-END:|159-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: image1 ">//GEN-BEGIN:|162-getter|0|162-preInit
    /**
     * Returns an initiliazed instance of image1 component.
     * @return the initialized component instance
     */
    public Image getImage1() {
        if (image1 == null) {//GEN-END:|162-getter|0|162-preInit
            // write pre-init user code here
            try {//GEN-BEGIN:|162-getter|1|162-@java.io.IOException
                image1 = Image.createImage("/images/oraculum_money548.jpg");
            } catch (java.io.IOException e) {//GEN-END:|162-getter|1|162-@java.io.IOException
                e.printStackTrace();
            }//GEN-LINE:|162-getter|2|162-postInit
        // write post-init user code here
        }//GEN-BEGIN:|162-getter|3|
        return image1;
    }
    //</editor-fold>//GEN-END:|162-getter|3|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: txtNomeTipoGR ">//GEN-BEGIN:|163-getter|0|163-preInit
    /**
     * Returns an initiliazed instance of txtNomeTipoGR component.
     * @return the initialized component instance
     */
    public TextField getTxtNomeTipoGR() {
        if (txtNomeTipoGR == null) {//GEN-END:|163-getter|0|163-preInit
            // write pre-init user code here
            txtNomeTipoGR = new TextField("Nome:", null, 32, TextField.ANY);//GEN-LINE:|163-getter|1|163-postInit
        // write post-init user code here
        }//GEN-BEGIN:|163-getter|2|
        return txtNomeTipoGR;
    }
    //</editor-fold>//GEN-END:|163-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdNovoUsuario ">//GEN-BEGIN:|164-getter|0|164-preInit
    /**
     * Returns an initiliazed instance of cmdNovoUsuario component.
     * @return the initialized component instance
     */
    public Command getCmdNovoUsuario() {
        if (cmdNovoUsuario == null) {//GEN-END:|164-getter|0|164-preInit
            // write pre-init user code here
            cmdNovoUsuario = new Command("Novo", Command.OK, 0);//GEN-LINE:|164-getter|1|164-postInit
        // write post-init user code here
        }//GEN-BEGIN:|164-getter|2|
        return cmdNovoUsuario;
    }
    //</editor-fold>//GEN-END:|164-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdNovoTipoGR ">//GEN-BEGIN:|167-getter|0|167-preInit
    /**
     * Returns an initiliazed instance of cmdNovoTipoGR component.
     * @return the initialized component instance
     */
    public Command getCmdNovoTipoGR() {
        if (cmdNovoTipoGR == null) {//GEN-END:|167-getter|0|167-preInit
            // write pre-init user code here
            cmdNovoTipoGR = new Command("Novo", Command.OK, 0);//GEN-LINE:|167-getter|1|167-postInit
        // write post-init user code here
        }//GEN-BEGIN:|167-getter|2|
        return cmdNovoTipoGR;
    }
    //</editor-fold>//GEN-END:|167-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: alertTipoGRDelete ">//GEN-BEGIN:|172-getter|0|172-preInit
    /**
     * Returns an initiliazed instance of alertTipoGRDelete component.
     * @return the initialized component instance
     */
    public Alert getAlertTipoGRDelete() {
        if (alertTipoGRDelete == null) {//GEN-END:|172-getter|0|172-preInit
            // write pre-init user code here
            alertTipoGRDelete = new Alert("Sucesso!", "Tipo de Gasto/Receita exclu\u00EDdo com sucesso!", null, AlertType.INFO);//GEN-BEGIN:|172-getter|1|172-postInit
            alertTipoGRDelete.setTimeout(Alert.FOREVER);//GEN-END:|172-getter|1|172-postInit
        // write post-init user code here
        }//GEN-BEGIN:|172-getter|2|
        return alertTipoGRDelete;
    }
    //</editor-fold>//GEN-END:|172-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdDeleteTipoGR ">//GEN-BEGIN:|170-getter|0|170-preInit
    /**
     * Returns an initiliazed instance of cmdDeleteTipoGR component.
     * @return the initialized component instance
     */
    public Command getCmdDeleteTipoGR() {
        if (cmdDeleteTipoGR == null) {//GEN-END:|170-getter|0|170-preInit
            // write pre-init user code here
            cmdDeleteTipoGR = new Command("Excluir", Command.OK, 0);//GEN-LINE:|170-getter|1|170-postInit
        // write post-init user code here
        }//GEN-BEGIN:|170-getter|2|
        return cmdDeleteTipoGR;
    }
    //</editor-fold>//GEN-END:|170-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdDeleteUsuario ">//GEN-BEGIN:|174-getter|0|174-preInit
    /**
     * Returns an initiliazed instance of cmdDeleteUsuario component.
     * @return the initialized component instance
     */
    public Command getCmdDeleteUsuario() {
        if (cmdDeleteUsuario == null) {//GEN-END:|174-getter|0|174-preInit
            // write pre-init user code here
            cmdDeleteUsuario = new Command("Excluir", Command.OK, 0);//GEN-LINE:|174-getter|1|174-postInit
        // write post-init user code here
        }//GEN-BEGIN:|174-getter|2|
        return cmdDeleteUsuario;
    }
    //</editor-fold>//GEN-END:|174-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: alertUsuarioDelete ">//GEN-BEGIN:|176-getter|0|176-preInit
    /**
     * Returns an initiliazed instance of alertUsuarioDelete component.
     * @return the initialized component instance
     */
    public Alert getAlertUsuarioDelete() {
        if (alertUsuarioDelete == null) {//GEN-END:|176-getter|0|176-preInit
            // write pre-init user code here
            alertUsuarioDelete = new Alert("alert", "Usu\u00E1rio exclu\u00EDdo com sucesso!", null, AlertType.INFO);//GEN-BEGIN:|176-getter|1|176-postInit
            alertUsuarioDelete.setTimeout(Alert.FOREVER);//GEN-END:|176-getter|1|176-postInit
        // write post-init user code here
        }//GEN-BEGIN:|176-getter|2|
        return alertUsuarioDelete;
    }
    //</editor-fold>//GEN-END:|176-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdOKListUsuario ">//GEN-BEGIN:|178-getter|0|178-preInit
    /**
     * Returns an initiliazed instance of cmdOKListUsuario component.
     * @return the initialized component instance
     */
    public Command getCmdOKListUsuario() {
        if (cmdOKListUsuario == null) {//GEN-END:|178-getter|0|178-preInit
            // write pre-init user code here
            cmdOKListUsuario = new Command("Ok", Command.OK, 0);//GEN-LINE:|178-getter|1|178-postInit
        // write post-init user code here
        }//GEN-BEGIN:|178-getter|2|
        return cmdOKListUsuario;
    }
    //</editor-fold>//GEN-END:|178-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: alertLogin ">//GEN-BEGIN:|188-getter|0|188-preInit
    /**
     * Returns an initiliazed instance of alertLogin component.
     * @return the initialized component instance
     */
    public Alert getAlertLogin() {
        if (alertLogin == null) {//GEN-END:|188-getter|0|188-preInit
            // write pre-init user code here
            alertLogin = new Alert("alert", "Usu\u00E1rio n\u00E3o cadastrado/login inv\u00E1lido/senha inv\u00E1lida!", null, AlertType.ERROR);//GEN-BEGIN:|188-getter|1|188-postInit
            alertLogin.addCommand(getCmdExitAlertLogin());
            alertLogin.setCommandListener(this);
            alertLogin.setTimeout(Alert.FOREVER);//GEN-END:|188-getter|1|188-postInit
        // write post-init user code here
        }//GEN-BEGIN:|188-getter|2|
        return alertLogin;
    }
    //</editor-fold>//GEN-END:|188-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdExitAlertLogin ">//GEN-BEGIN:|189-getter|0|189-preInit
    /**
     * Returns an initiliazed instance of cmdExitAlertLogin component.
     * @return the initialized component instance
     */
    public Command getCmdExitAlertLogin() {
        if (cmdExitAlertLogin == null) {//GEN-END:|189-getter|0|189-preInit
            // write pre-init user code here
            cmdExitAlertLogin = new Command("Exit", Command.EXIT, 0);//GEN-LINE:|189-getter|1|189-postInit
        // write post-init user code here
        }//GEN-BEGIN:|189-getter|2|
        return cmdExitAlertLogin;
    }
    //</editor-fold>//GEN-END:|189-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdScreenLoginCadUsuario ">//GEN-BEGIN:|192-getter|0|192-preInit
    /**
     * Returns an initiliazed instance of cmdScreenLoginCadUsuario component.
     * @return the initialized component instance
     */
    public Command getCmdScreenLoginCadUsuario() {
        if (cmdScreenLoginCadUsuario == null) {//GEN-END:|192-getter|0|192-preInit
            // write pre-init user code here
            cmdScreenLoginCadUsuario = new Command("Cadastro de Usu\u00E1rio", Command.SCREEN, 0);//GEN-LINE:|192-getter|1|192-postInit
        // write post-init user code here
        }//GEN-BEGIN:|192-getter|2|
        return cmdScreenLoginCadUsuario;
    }
    //</editor-fold>//GEN-END:|192-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: listGastosReceitas ">//GEN-BEGIN:|195-getter|0|195-preInit
    /**
     * Returns an initiliazed instance of listGastosReceitas component.
     * @return the initialized component instance
     */
    public List getListGastosReceitas() {
        if (listGastosReceitas == null) {//GEN-END:|195-getter|0|195-preInit
            // write pre-init user code here
            listGastosReceitas = new List("list", Choice.EXCLUSIVE);//GEN-BEGIN:|195-getter|1|195-postInit
            listGastosReceitas.addCommand(getCmdOKListGR());
            listGastosReceitas.addCommand(getCmdBackListGRCadGR());
            listGastosReceitas.setCommandListener(this);//GEN-END:|195-getter|1|195-postInit
        // write post-init user code here
        }//GEN-BEGIN:|195-getter|2|
        return listGastosReceitas;
    }
    //</editor-fold>//GEN-END:|195-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: listGastosReceitasAction ">//GEN-BEGIN:|195-action|0|195-preAction
    /**
     * Performs an action assigned to the selected list element in the listGastosReceitas component.
     */
    public void listGastosReceitasAction() {//GEN-END:|195-action|0|195-preAction
        // enter pre-action user code here
        String __selectedString = getListGastosReceitas().getString(getListGastosReceitas().getSelectedIndex());//GEN-LINE:|195-action|1|195-postAction
    // enter post-action user code here
    }//GEN-BEGIN:|195-action|2|
    //</editor-fold>//GEN-END:|195-action|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: alertGRCadastro ">//GEN-BEGIN:|207-getter|0|207-preInit
    /**
     * Returns an initiliazed instance of alertGRCadastro component.
     * @return the initialized component instance
     */
    public Alert getAlertGRCadastro() {
        if (alertGRCadastro == null) {//GEN-END:|207-getter|0|207-preInit
            // write pre-init user code here
            alertGRCadastro = new Alert("Sucesso!", "Salvo com sucesso!", null, AlertType.INFO);//GEN-BEGIN:|207-getter|1|207-postInit
            alertGRCadastro.setTimeout(Alert.FOREVER);//GEN-END:|207-getter|1|207-postInit
        // write post-init user code here
        }//GEN-BEGIN:|207-getter|2|
        return alertGRCadastro;
    }
    //</editor-fold>//GEN-END:|207-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: alertGRDelete ">//GEN-BEGIN:|208-getter|0|208-preInit
    /**
     * Returns an initiliazed instance of alertGRDelete component.
     * @return the initialized component instance
     */
    public Alert getAlertGRDelete() {
        if (alertGRDelete == null) {//GEN-END:|208-getter|0|208-preInit
            // write pre-init user code here
            alertGRDelete = new Alert("Exclus\u00E3o!", "Exclu\u00EDdo com sucesso!", null, AlertType.INFO);//GEN-BEGIN:|208-getter|1|208-postInit
            alertGRDelete.setTimeout(Alert.FOREVER);//GEN-END:|208-getter|1|208-postInit
        // write post-init user code here
        }//GEN-BEGIN:|208-getter|2|
        return alertGRDelete;
    }
    //</editor-fold>//GEN-END:|208-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdOKListGR ">//GEN-BEGIN:|199-getter|0|199-preInit
    /**
     * Returns an initiliazed instance of cmdOKListGR component.
     * @return the initialized component instance
     */
    public Command getCmdOKListGR() {
        if (cmdOKListGR == null) {//GEN-END:|199-getter|0|199-preInit
            // write pre-init user code here
            cmdOKListGR = new Command("Ok", Command.OK, 0);//GEN-LINE:|199-getter|1|199-postInit
        // write post-init user code here
        }//GEN-BEGIN:|199-getter|2|
        return cmdOKListGR;
    }
    //</editor-fold>//GEN-END:|199-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdBackListGRCadGR ">//GEN-BEGIN:|201-getter|0|201-preInit
    /**
     * Returns an initiliazed instance of cmdBackListGRCadGR component.
     * @return the initialized component instance
     */
    public Command getCmdBackListGRCadGR() {
        if (cmdBackListGRCadGR == null) {//GEN-END:|201-getter|0|201-preInit
            // write pre-init user code here
            cmdBackListGRCadGR = new Command("Back", Command.BACK, 0);//GEN-LINE:|201-getter|1|201-postInit
        // write post-init user code here
        }//GEN-BEGIN:|201-getter|2|
        return cmdBackListGRCadGR;
    }
    //</editor-fold>//GEN-END:|201-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdDeleteGR ">//GEN-BEGIN:|205-getter|0|205-preInit
    /**
     * Returns an initiliazed instance of cmdDeleteGR component.
     * @return the initialized component instance
     */
    public Command getCmdDeleteGR() {
        if (cmdDeleteGR == null) {//GEN-END:|205-getter|0|205-preInit
            // write pre-init user code here
            cmdDeleteGR = new Command("Excluir", Command.OK, 0);//GEN-LINE:|205-getter|1|205-postInit
        // write post-init user code here
        }//GEN-BEGIN:|205-getter|2|
        return cmdDeleteGR;
    }
    //</editor-fold>//GEN-END:|205-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: listGastosReceitasTiposGR ">//GEN-BEGIN:|211-getter|0|211-preInit
    /**
     * Returns an initiliazed instance of listGastosReceitasTiposGR component.
     * @return the initialized component instance
     */
    public List getListGastosReceitasTiposGR() {
        if (listGastosReceitasTiposGR == null) {//GEN-END:|211-getter|0|211-preInit
            // write pre-init user code here
            listGastosReceitasTiposGR = new List("list", Choice.EXCLUSIVE);//GEN-BEGIN:|211-getter|1|211-postInit
            listGastosReceitasTiposGR.addCommand(getCmdOKListGOTiposGR());
            listGastosReceitasTiposGR.addCommand(getCmdBackListTiposGRCadGR());
            listGastosReceitasTiposGR.setCommandListener(this);//GEN-END:|211-getter|1|211-postInit
        // write post-init user code here
        }//GEN-BEGIN:|211-getter|2|
        return listGastosReceitasTiposGR;
    }
    //</editor-fold>//GEN-END:|211-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: listGastosReceitasTiposGRAction ">//GEN-BEGIN:|211-action|0|211-preAction
    /**
     * Performs an action assigned to the selected list element in the listGastosReceitasTiposGR component.
     */
    public void listGastosReceitasTiposGRAction() {//GEN-END:|211-action|0|211-preAction
        // enter pre-action user code here
        String __selectedString = getListGastosReceitasTiposGR().getString(getListGastosReceitasTiposGR().getSelectedIndex());//GEN-LINE:|211-action|1|211-postAction
    // enter post-action user code here
    }//GEN-BEGIN:|211-action|2|
    //</editor-fold>//GEN-END:|211-action|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdScreenGastosReceitas ">//GEN-BEGIN:|214-getter|0|214-preInit
    /**
     * Returns an initiliazed instance of cmdScreenGastosReceitas component.
     * @return the initialized component instance
     */
    public Command getCmdScreenGastosReceitas() {
        if (cmdScreenGastosReceitas == null) {//GEN-END:|214-getter|0|214-preInit
            // write pre-init user code here
            cmdScreenGastosReceitas = new Command("Item", Command.SCREEN, 0);//GEN-LINE:|214-getter|1|214-postInit
        // write post-init user code here
        }//GEN-BEGIN:|214-getter|2|
        return cmdScreenGastosReceitas;
    }
    //</editor-fold>//GEN-END:|214-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdOKListGOTiposGR ">//GEN-BEGIN:|218-getter|0|218-preInit
    /**
     * Returns an initiliazed instance of cmdOKListGOTiposGR component.
     * @return the initialized component instance
     */
    public Command getCmdOKListGOTiposGR() {
        if (cmdOKListGOTiposGR == null) {//GEN-END:|218-getter|0|218-preInit
            // write pre-init user code here
            cmdOKListGOTiposGR = new Command("Ok", Command.OK, 0);//GEN-LINE:|218-getter|1|218-postInit
        // write post-init user code here
        }//GEN-BEGIN:|218-getter|2|
        return cmdOKListGOTiposGR;
    }
    //</editor-fold>//GEN-END:|218-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdBackListTiposGRCadGR ">//GEN-BEGIN:|220-getter|0|220-preInit
    /**
     * Returns an initiliazed instance of cmdBackListTiposGRCadGR component.
     * @return the initialized component instance
     */
    public Command getCmdBackListTiposGRCadGR() {
        if (cmdBackListTiposGRCadGR == null) {//GEN-END:|220-getter|0|220-preInit
            // write pre-init user code here
            cmdBackListTiposGRCadGR = new Command("Back", Command.BACK, 0);//GEN-LINE:|220-getter|1|220-postInit
        // write post-init user code here
        }//GEN-BEGIN:|220-getter|2|
        return cmdBackListTiposGRCadGR;
    }
    //</editor-fold>//GEN-END:|220-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdCancelGastosReceitas ">//GEN-BEGIN:|224-getter|0|224-preInit
    /**
     * Returns an initiliazed instance of cmdCancelGastosReceitas component.
     * @return the initialized component instance
     */
    public Command getCmdCancelGastosReceitas() {
        if (cmdCancelGastosReceitas == null) {//GEN-END:|224-getter|0|224-preInit
            // write pre-init user code here
            cmdCancelGastosReceitas = new Command("Cancel", Command.CANCEL, 0);//GEN-LINE:|224-getter|1|224-postInit
        // write post-init user code here
        }//GEN-BEGIN:|224-getter|2|
        return cmdCancelGastosReceitas;
    }
    //</editor-fold>//GEN-END:|224-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: frmCadInvestimento ">//GEN-BEGIN:|227-getter|0|227-preInit
    /**
     * Returns an initiliazed instance of frmCadInvestimento component.
     * @return the initialized component instance
     */
    public Form getFrmCadInvestimento() {
        if (frmCadInvestimento == null) {//GEN-END:|227-getter|0|227-preInit
            // write pre-init user code here
            frmCadInvestimento = new Form("Cadastro de investimentos", new Item[] { getTxtNome(), getTxtDescricao(), getDfDataUltAt(), getTxtValorAntInvest(), getTxtValorUltAt() });//GEN-BEGIN:|227-getter|1|227-postInit
            frmCadInvestimento.addCommand(getCmdOkInvestimento());
            frmCadInvestimento.addCommand(getCmdCancelInvest());
            frmCadInvestimento.addCommand(getCmdNovoInvest());
            frmCadInvestimento.addCommand(getCmdDeleteInvest());
            frmCadInvestimento.addCommand(getCmdExitInvestimento());
            frmCadInvestimento.addCommand(getCmdItemInvestimento());
            frmCadInvestimento.setCommandListener(this);//GEN-END:|227-getter|1|227-postInit
        // write post-init user code here
        }//GEN-BEGIN:|227-getter|2|
        return frmCadInvestimento;
    }
    //</editor-fold>//GEN-END:|227-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: txtDescricao ">//GEN-BEGIN:|240-getter|0|240-preInit
    /**
     * Returns an initiliazed instance of txtDescricao component.
     * @return the initialized component instance
     */
    public TextField getTxtDescricao() {
        if (txtDescricao == null) {//GEN-END:|240-getter|0|240-preInit
            // write pre-init user code here
            txtDescricao = new TextField("Descri\u00E7\u00E3o", null, 32, TextField.ANY);//GEN-LINE:|240-getter|1|240-postInit
        // write post-init user code here
        }//GEN-BEGIN:|240-getter|2|
        return txtDescricao;
    }
    //</editor-fold>//GEN-END:|240-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: alertInvestimento ">//GEN-BEGIN:|237-getter|0|237-preInit
    /**
     * Returns an initiliazed instance of alertInvestimento component.
     * @return the initialized component instance
     */
    public Alert getAlertInvestimento() {
        if (alertInvestimento == null) {//GEN-END:|237-getter|0|237-preInit
            // write pre-init user code here
            alertInvestimento = new Alert("Informa\u00E7\u00E3o!", "Investimento salvo com sucesso!", null, AlertType.INFO);//GEN-BEGIN:|237-getter|1|237-postInit
            alertInvestimento.setTimeout(Alert.FOREVER);//GEN-END:|237-getter|1|237-postInit
        // write post-init user code here
        }//GEN-BEGIN:|237-getter|2|
        return alertInvestimento;
    }
    //</editor-fold>//GEN-END:|237-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdOkInvestimento ">//GEN-BEGIN:|231-getter|0|231-preInit
    /**
     * Returns an initiliazed instance of cmdOkInvestimento component.
     * @return the initialized component instance
     */
    public Command getCmdOkInvestimento() {
        if (cmdOkInvestimento == null) {//GEN-END:|231-getter|0|231-preInit
            // write pre-init user code here
            cmdOkInvestimento = new Command("Salvar", Command.OK, 0);//GEN-LINE:|231-getter|1|231-postInit
        // write post-init user code here
        }//GEN-BEGIN:|231-getter|2|
        return cmdOkInvestimento;
    }
    //</editor-fold>//GEN-END:|231-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdExitInvestimento ">//GEN-BEGIN:|233-getter|0|233-preInit
    /**
     * Returns an initiliazed instance of cmdExitInvestimento component.
     * @return the initialized component instance
     */
    public Command getCmdExitInvestimento() {
        if (cmdExitInvestimento == null) {//GEN-END:|233-getter|0|233-preInit
            // write pre-init user code here
            cmdExitInvestimento = new Command("Sair", Command.EXIT, 0);//GEN-LINE:|233-getter|1|233-postInit
        // write post-init user code here
        }//GEN-BEGIN:|233-getter|2|
        return cmdExitInvestimento;
    }
    //</editor-fold>//GEN-END:|233-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: listRelatorio ">//GEN-BEGIN:|244-getter|0|244-preInit
    /**
     * Returns an initiliazed instance of listRelatorio component.
     * @return the initialized component instance
     */
    public List getListRelatorio() {
        if (listRelatorio == null) {//GEN-END:|244-getter|0|244-preInit
            // write pre-init user code here
            listRelatorio = new List("list", Choice.IMPLICIT);//GEN-BEGIN:|244-getter|1|244-postInit
            listRelatorio.append("Gastos/Receitas por Per\u00EDodo", null);
            listRelatorio.append("Saldo", null);
            listRelatorio.addCommand(getCmdExitRelatorio());
            listRelatorio.setCommandListener(this);
            listRelatorio.setSelectedFlags(new boolean[] { false, false });//GEN-END:|244-getter|1|244-postInit
        // write post-init user code here
        }//GEN-BEGIN:|244-getter|2|
        return listRelatorio;
    }
    //</editor-fold>//GEN-END:|244-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: listRelatorioAction ">//GEN-BEGIN:|244-action|0|244-preAction
    /**
     * Performs an action assigned to the selected list element in the listRelatorio component.
     */
    public void listRelatorioAction() {//GEN-END:|244-action|0|244-preAction
        // enter pre-action user code here
        String __selectedString = getListRelatorio().getString(getListRelatorio().getSelectedIndex());//GEN-BEGIN:|244-action|1|250-preAction
        if (__selectedString != null) {
            if (__selectedString.equals("Gastos/Receitas por Per\u00EDodo")) {//GEN-END:|244-action|1|250-preAction
                // write pre-action user code here
                switchDisplayable(null, getFrmRelGastoReceitas());//GEN-LINE:|244-action|2|250-postAction
            // write post-action user code here
            } else if (__selectedString.equals("Saldo")) {//GEN-LINE:|244-action|3|249-preAction
                // write pre-action user code here
                ObjectSet os = null;
                GastosReceitas grAux = new GastosReceitas();
                double dSaldo = 0.00D;
                try {
                    os = fu.findFilter(grAux, new GastoReceitasFilter(gUsuario, null, 'C'));
                    for (int i = 0; i < os.size(); i++) {
                        grAux = (GastosReceitas) os.get(i);
                        if ((grAux.getTipoGR().getDebitoCredito() == 'D')) {
                            dSaldo -= grAux.getValor();
                        } else if ((grAux.getTipoGR().getDebitoCredito() == 'C')) {
                            dSaldo += grAux.getValor();
                        }
                    }
                } catch (FloggyException ex) {
                    ex.printStackTrace();
                }
                getAlertSaldo().setString("Seu saldo é: " + String.valueOf(dSaldo));
                switchDisplayable(getAlertSaldo(), getListRelatorio());//GEN-LINE:|244-action|4|249-postAction
            // write post-action user code here
            }//GEN-BEGIN:|244-action|5|244-postAction
        }//GEN-END:|244-action|5|244-postAction
    // enter post-action user code here
    }//GEN-BEGIN:|244-action|6|
    //</editor-fold>//GEN-END:|244-action|6|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: frmRelGastoReceitas ">//GEN-BEGIN:|254-getter|0|254-preInit
    /**
     * Returns an initiliazed instance of frmRelGastoReceitas component.
     * @return the initialized component instance
     */
    public Form getFrmRelGastoReceitas() {
        if (frmRelGastoReceitas == null) {//GEN-END:|254-getter|0|254-preInit
            // write pre-init user code here
            frmRelGastoReceitas = new Form("Relat\u00F3rio de Gastos e Receitas", new Item[] { getCgRelGastosReceitas(), getCgData(), getLblPeriodo(), getDfDeRelGR(), getDfAteRelGR() });//GEN-BEGIN:|254-getter|1|254-postInit
            frmRelGastoReceitas.addCommand(getCmdOkRelGastosReceitas());
            frmRelGastoReceitas.addCommand(getCmdExitRelGastosReceitas());
            frmRelGastoReceitas.setCommandListener(this);//GEN-END:|254-getter|1|254-postInit
        // write post-init user code here
        }//GEN-BEGIN:|254-getter|2|
        return frmRelGastoReceitas;
    }
    //</editor-fold>//GEN-END:|254-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cgData ">//GEN-BEGIN:|271-getter|0|271-preInit
    /**
     * Returns an initiliazed instance of cgData component.
     * @return the initialized component instance
     */
    public ChoiceGroup getCgData() {
        if (cgData == null) {//GEN-END:|271-getter|0|271-preInit
            // write pre-init user code here
            cgData = new ChoiceGroup("Data", Choice.EXCLUSIVE);//GEN-BEGIN:|271-getter|1|271-postInit
            cgData.append("Emiss\u00E3o", null);
            cgData.append("Vencimento", null);
            cgData.append("Pagamento", null);
            cgData.setLayout(ImageItem.LAYOUT_DEFAULT);
            cgData.setSelectedFlags(new boolean[] { true, false, false });
            cgData.setFont(0, null);
            cgData.setFont(1, null);
            cgData.setFont(2, null);//GEN-END:|271-getter|1|271-postInit
        // write post-init user code here
        }//GEN-BEGIN:|271-getter|2|
        return cgData;
    }
    //</editor-fold>//GEN-END:|271-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: dfDeRelGR ">//GEN-BEGIN:|275-getter|0|275-preInit
    /**
     * Returns an initiliazed instance of dfDeRelGR component.
     * @return the initialized component instance
     */
    public DateField getDfDeRelGR() {
        if (dfDeRelGR == null) {//GEN-END:|275-getter|0|275-preInit
            // write pre-init user code here
            dfDeRelGR = new DateField("De:", DateField.DATE, java.util.TimeZone.getTimeZone("Brazil/East"));//GEN-BEGIN:|275-getter|1|275-postInit
            dfDeRelGR.setLayout(ImageItem.LAYOUT_DEFAULT | Item.LAYOUT_SHRINK | Item.LAYOUT_VSHRINK | Item.LAYOUT_EXPAND | Item.LAYOUT_2);
            dfDeRelGR.setDate(new java.util.Date(System.currentTimeMillis()));//GEN-END:|275-getter|1|275-postInit
        // write post-init user code here
        }//GEN-BEGIN:|275-getter|2|
        return dfDeRelGR;
    }
    //</editor-fold>//GEN-END:|275-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: dfAteRelGR ">//GEN-BEGIN:|276-getter|0|276-preInit
    /**
     * Returns an initiliazed instance of dfAteRelGR component.
     * @return the initialized component instance
     */
    public DateField getDfAteRelGR() {
        if (dfAteRelGR == null) {//GEN-END:|276-getter|0|276-preInit
            // write pre-init user code here
            dfAteRelGR = new DateField("At\u00E9:", DateField.DATE, java.util.TimeZone.getTimeZone("Brazil/East"));//GEN-BEGIN:|276-getter|1|276-postInit
            dfAteRelGR.setLayout(ImageItem.LAYOUT_DEFAULT | Item.LAYOUT_SHRINK | Item.LAYOUT_VSHRINK | Item.LAYOUT_EXPAND | Item.LAYOUT_2);
            dfAteRelGR.setDate(new java.util.Date(System.currentTimeMillis()));//GEN-END:|276-getter|1|276-postInit
        // write post-init user code here
        }//GEN-BEGIN:|276-getter|2|
        return dfAteRelGR;
    }
    //</editor-fold>//GEN-END:|276-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: lblPeriodo ">//GEN-BEGIN:|277-getter|0|277-preInit
    /**
     * Returns an initiliazed instance of lblPeriodo component.
     * @return the initialized component instance
     */
    public StringItem getLblPeriodo() {
        if (lblPeriodo == null) {//GEN-END:|277-getter|0|277-preInit
            // write pre-init user code here
            lblPeriodo = new StringItem("Periodo", "", Item.PLAIN);//GEN-BEGIN:|277-getter|1|277-postInit
            lblPeriodo.setLayout(ImageItem.LAYOUT_LEFT | Item.LAYOUT_TOP | Item.LAYOUT_VCENTER | ImageItem.LAYOUT_NEWLINE_AFTER | Item.LAYOUT_SHRINK | Item.LAYOUT_VSHRINK | Item.LAYOUT_2);//GEN-END:|277-getter|1|277-postInit
        // write post-init user code here
        }//GEN-BEGIN:|277-getter|2|
        return lblPeriodo;
    }
    //</editor-fold>//GEN-END:|277-getter|2|



    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cgRelGastosReceitas ">//GEN-BEGIN:|279-getter|0|279-preInit
    /**
     * Returns an initiliazed instance of cgRelGastosReceitas component.
     * @return the initialized component instance
     */
    public ChoiceGroup getCgRelGastosReceitas() {
        if (cgRelGastosReceitas == null) {//GEN-END:|279-getter|0|279-preInit
            // write pre-init user code here
            cgRelGastosReceitas = new ChoiceGroup("Listar", Choice.MULTIPLE);//GEN-BEGIN:|279-getter|1|279-postInit
            cgRelGastosReceitas.append("Gastos", null);
            cgRelGastosReceitas.append("Receitas", null);
            cgRelGastosReceitas.setFitPolicy(Choice.TEXT_WRAP_ON);
            cgRelGastosReceitas.setSelectedFlags(new boolean[] { false, false });
            cgRelGastosReceitas.setFont(0, null);
            cgRelGastosReceitas.setFont(1, null);//GEN-END:|279-getter|1|279-postInit
        // write post-init user code here
        }//GEN-BEGIN:|279-getter|2|
        return cgRelGastosReceitas;
    }
    //</editor-fold>//GEN-END:|279-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: alertSaldo ">//GEN-BEGIN:|255-getter|0|255-preInit
    /**
     * Returns an initiliazed instance of alertSaldo component.
     * @return the initialized component instance
     */
    public Alert getAlertSaldo() {
        if (alertSaldo == null) {//GEN-END:|255-getter|0|255-preInit
            // write pre-init user code here
            alertSaldo = new Alert("Saldo", null, null, AlertType.CONFIRMATION);//GEN-BEGIN:|255-getter|1|255-postInit
            alertSaldo.setTimeout(Alert.FOREVER);//GEN-END:|255-getter|1|255-postInit
        // write post-init user code here
        }//GEN-BEGIN:|255-getter|2|
        return alertSaldo;
    }
    //</editor-fold>//GEN-END:|255-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: tbxRelatorio ">//GEN-BEGIN:|266-getter|0|266-preInit
    /**
     * Returns an initiliazed instance of tbxRelatorio component.
     * @return the initialized component instance
     */
    public TextBox getTbxRelatorio() {
        if (tbxRelatorio == null) {//GEN-END:|266-getter|0|266-preInit
            // write pre-init user code here
            tbxRelatorio = new TextBox("Relat\u00F3rio", "", 1000, TextField.ANY | TextField.UNEDITABLE);//GEN-BEGIN:|266-getter|1|266-postInit
            tbxRelatorio.addCommand(getCmdOkRelatorio());
            tbxRelatorio.setCommandListener(this);//GEN-END:|266-getter|1|266-postInit
        // write post-init user code here
        }//GEN-BEGIN:|266-getter|2|
        return tbxRelatorio;
    }
    //</editor-fold>//GEN-END:|266-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdExitRelatorio ">//GEN-BEGIN:|256-getter|0|256-preInit
    /**
     * Returns an initiliazed instance of cmdExitRelatorio component.
     * @return the initialized component instance
     */
    public Command getCmdExitRelatorio() {
        if (cmdExitRelatorio == null) {//GEN-END:|256-getter|0|256-preInit
            // write pre-init user code here
            cmdExitRelatorio = new Command("Sair", Command.EXIT, 0);//GEN-LINE:|256-getter|1|256-postInit
        // write post-init user code here
        }//GEN-BEGIN:|256-getter|2|
        return cmdExitRelatorio;
    }
    //</editor-fold>//GEN-END:|256-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdOkRelGastosReceitas ">//GEN-BEGIN:|261-getter|0|261-preInit
    /**
     * Returns an initiliazed instance of cmdOkRelGastosReceitas component.
     * @return the initialized component instance
     */
    public Command getCmdOkRelGastosReceitas() {
        if (cmdOkRelGastosReceitas == null) {//GEN-END:|261-getter|0|261-preInit
            // write pre-init user code here
            cmdOkRelGastosReceitas = new Command("Ok", Command.OK, 0);//GEN-LINE:|261-getter|1|261-postInit
        // write post-init user code here
        }//GEN-BEGIN:|261-getter|2|
        return cmdOkRelGastosReceitas;
    }
    //</editor-fold>//GEN-END:|261-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdExitRelGastosReceitas ">//GEN-BEGIN:|263-getter|0|263-preInit
    /**
     * Returns an initiliazed instance of cmdExitRelGastosReceitas component.
     * @return the initialized component instance
     */
    public Command getCmdExitRelGastosReceitas() {
        if (cmdExitRelGastosReceitas == null) {//GEN-END:|263-getter|0|263-preInit
            // write pre-init user code here
            cmdExitRelGastosReceitas = new Command("Sair", Command.EXIT, 0);//GEN-LINE:|263-getter|1|263-postInit
        // write post-init user code here
        }//GEN-BEGIN:|263-getter|2|
        return cmdExitRelGastosReceitas;
    }
    //</editor-fold>//GEN-END:|263-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdOkRelatorio ">//GEN-BEGIN:|267-getter|0|267-preInit
    /**
     * Returns an initiliazed instance of cmdOkRelatorio component.
     * @return the initialized component instance
     */
    public Command getCmdOkRelatorio() {
        if (cmdOkRelatorio == null) {//GEN-END:|267-getter|0|267-preInit
            // write pre-init user code here
            cmdOkRelatorio = new Command("Ok", Command.OK, 0);//GEN-LINE:|267-getter|1|267-postInit
        // write post-init user code here
        }//GEN-BEGIN:|267-getter|2|
        return cmdOkRelatorio;
    }
    //</editor-fold>//GEN-END:|267-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdCancelTiposGr ">//GEN-BEGIN:|282-getter|0|282-preInit
    /**
     * Returns an initiliazed instance of cmdCancelTiposGr component.
     * @return the initialized component instance
     */
    public Command getCmdCancelTiposGr() {
        if (cmdCancelTiposGr == null) {//GEN-END:|282-getter|0|282-preInit
            // write pre-init user code here
            cmdCancelTiposGr = new Command("Cancelar", Command.CANCEL, 0);//GEN-LINE:|282-getter|1|282-postInit
        // write post-init user code here
        }//GEN-BEGIN:|282-getter|2|
        return cmdCancelTiposGr;
    }
    //</editor-fold>//GEN-END:|282-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: txtNome ">//GEN-BEGIN:|284-getter|0|284-preInit
    /**
     * Returns an initiliazed instance of txtNome component.
     * @return the initialized component instance
     */
    public TextField getTxtNome() {
        if (txtNome == null) {//GEN-END:|284-getter|0|284-preInit
            // write pre-init user code here
            txtNome = new TextField("Nome", null, 32, TextField.ANY);//GEN-LINE:|284-getter|1|284-postInit
        // write post-init user code here
        }//GEN-BEGIN:|284-getter|2|
        return txtNome;
    }
    //</editor-fold>//GEN-END:|284-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: txtValorAntInvest ">//GEN-BEGIN:|285-getter|0|285-preInit
    /**
     * Returns an initiliazed instance of txtValorAntInvest component.
     * @return the initialized component instance
     */
    public TextField getTxtValorAntInvest() {
        if (txtValorAntInvest == null) {//GEN-END:|285-getter|0|285-preInit
            // write pre-init user code here
            txtValorAntInvest = new TextField("Valor \u00DAltima Altera\u00E7\u00E3o", null, 32, TextField.DECIMAL);//GEN-LINE:|285-getter|1|285-postInit
        // write post-init user code here
        }//GEN-BEGIN:|285-getter|2|
        return txtValorAntInvest;
    }
    //</editor-fold>//GEN-END:|285-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: dfDataUltAt ">//GEN-BEGIN:|286-getter|0|286-preInit
    /**
     * Returns an initiliazed instance of dfDataUltAt component.
     * @return the initialized component instance
     */
    public DateField getDfDataUltAt() {
        if (dfDataUltAt == null) {//GEN-END:|286-getter|0|286-preInit
            // write pre-init user code here
            dfDataUltAt = new DateField("Data \u00DAltima Atualiza\u00E7\u00E3o", DateField.DATE_TIME);//GEN-BEGIN:|286-getter|1|286-postInit
            dfDataUltAt.setDate(new java.util.Date(System.currentTimeMillis()));//GEN-END:|286-getter|1|286-postInit
        // write post-init user code here
        }//GEN-BEGIN:|286-getter|2|
        return dfDataUltAt;
    }
    //</editor-fold>//GEN-END:|286-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: txtValorUltAt ">//GEN-BEGIN:|287-getter|0|287-preInit
    /**
     * Returns an initiliazed instance of txtValorUltAt component.
     * @return the initialized component instance
     */
    public TextField getTxtValorUltAt() {
        if (txtValorUltAt == null) {//GEN-END:|287-getter|0|287-preInit
            // write pre-init user code here
            txtValorUltAt = new TextField("Valor Atual", null, 32, TextField.DECIMAL);//GEN-LINE:|287-getter|1|287-postInit
        // write post-init user code here
        }//GEN-BEGIN:|287-getter|2|
        return txtValorUltAt;
    }
    //</editor-fold>//GEN-END:|287-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdCancelInvest ">//GEN-BEGIN:|289-getter|0|289-preInit
    /**
     * Returns an initiliazed instance of cmdCancelInvest component.
     * @return the initialized component instance
     */
    public Command getCmdCancelInvest() {
        if (cmdCancelInvest == null) {//GEN-END:|289-getter|0|289-preInit
            // write pre-init user code here
            cmdCancelInvest = new Command("Cancelar", Command.CANCEL, 0);//GEN-LINE:|289-getter|1|289-postInit
        // write post-init user code here
        }//GEN-BEGIN:|289-getter|2|
        return cmdCancelInvest;
    }
    //</editor-fold>//GEN-END:|289-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: itemCommand ">//GEN-BEGIN:|291-getter|0|291-preInit
    /**
     * Returns an initiliazed instance of itemCommand component.
     * @return the initialized component instance
     */
    public Command getItemCommand() {
        if (itemCommand == null) {//GEN-END:|291-getter|0|291-preInit
            // write pre-init user code here
            itemCommand = new Command("Item", Command.ITEM, 0);//GEN-LINE:|291-getter|1|291-postInit
        // write post-init user code here
        }//GEN-BEGIN:|291-getter|2|
        return itemCommand;
    }
    //</editor-fold>//GEN-END:|291-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdNovoInvest ">//GEN-BEGIN:|293-getter|0|293-preInit
    /**
     * Returns an initiliazed instance of cmdNovoInvest component.
     * @return the initialized component instance
     */
    public Command getCmdNovoInvest() {
        if (cmdNovoInvest == null) {//GEN-END:|293-getter|0|293-preInit
            // write pre-init user code here
            cmdNovoInvest = new Command("Novo", Command.OK, 0);//GEN-LINE:|293-getter|1|293-postInit
        // write post-init user code here
        }//GEN-BEGIN:|293-getter|2|
        return cmdNovoInvest;
    }
    //</editor-fold>//GEN-END:|293-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdDeleteInvest ">//GEN-BEGIN:|296-getter|0|296-preInit
    /**
     * Returns an initiliazed instance of cmdDeleteInvest component.
     * @return the initialized component instance
     */
    public Command getCmdDeleteInvest() {
        if (cmdDeleteInvest == null) {//GEN-END:|296-getter|0|296-preInit
            // write pre-init user code here
            cmdDeleteInvest = new Command("Excluir", Command.OK, 0);//GEN-LINE:|296-getter|1|296-postInit
        // write post-init user code here
        }//GEN-BEGIN:|296-getter|2|
        return cmdDeleteInvest;
    }
    //</editor-fold>//GEN-END:|296-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: listInvestimentos ">//GEN-BEGIN:|299-getter|0|299-preInit
    /**
     * Returns an initiliazed instance of listInvestimentos component.
     * @return the initialized component instance
     */
    public List getListInvestimentos() {
        if (listInvestimentos == null) {//GEN-END:|299-getter|0|299-preInit
            // write pre-init user code here
            listInvestimentos = new List("Lista de Investimentos", Choice.IMPLICIT);//GEN-BEGIN:|299-getter|1|299-postInit
            listInvestimentos.addCommand(getCmdExitListInvest());
            listInvestimentos.addCommand(getCmdOkListInvest());
            listInvestimentos.setCommandListener(this);//GEN-END:|299-getter|1|299-postInit
        // write post-init user code here
        }//GEN-BEGIN:|299-getter|2|
        return listInvestimentos;
    }
    //</editor-fold>//GEN-END:|299-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: listInvestimentosAction ">//GEN-BEGIN:|299-action|0|299-preAction
    /**
     * Performs an action assigned to the selected list element in the listInvestimentos component.
     */
    public void listInvestimentosAction() {//GEN-END:|299-action|0|299-preAction
        // enter pre-action user code here
        String __selectedString = getListInvestimentos().getString(getListInvestimentos().getSelectedIndex());//GEN-LINE:|299-action|1|299-postAction
    // enter post-action user code here
    }//GEN-BEGIN:|299-action|2|
    //</editor-fold>//GEN-END:|299-action|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdItemInvestimento ">//GEN-BEGIN:|302-getter|0|302-preInit
    /**
     * Returns an initiliazed instance of cmdItemInvestimento component.
     * @return the initialized component instance
     */
    public Command getCmdItemInvestimento() {
        if (cmdItemInvestimento == null) {//GEN-END:|302-getter|0|302-preInit
            // write pre-init user code here
            cmdItemInvestimento = new Command("Item", Command.ITEM, 0);//GEN-LINE:|302-getter|1|302-postInit
        // write post-init user code here
        }//GEN-BEGIN:|302-getter|2|
        return cmdItemInvestimento;
    }
    //</editor-fold>//GEN-END:|302-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdExitListInvest ">//GEN-BEGIN:|305-getter|0|305-preInit
    /**
     * Returns an initiliazed instance of cmdExitListInvest component.
     * @return the initialized component instance
     */
    public Command getCmdExitListInvest() {
        if (cmdExitListInvest == null) {//GEN-END:|305-getter|0|305-preInit
            // write pre-init user code here
            cmdExitListInvest = new Command("Sair", Command.EXIT, 0);//GEN-LINE:|305-getter|1|305-postInit
        // write post-init user code here
        }//GEN-BEGIN:|305-getter|2|
        return cmdExitListInvest;
    }
    //</editor-fold>//GEN-END:|305-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdOkListInvest ">//GEN-BEGIN:|308-getter|0|308-preInit
    /**
     * Returns an initiliazed instance of cmdOkListInvest component.
     * @return the initialized component instance
     */
    public Command getCmdOkListInvest() {
        if (cmdOkListInvest == null) {//GEN-END:|308-getter|0|308-preInit
            // write pre-init user code here
            cmdOkListInvest = new Command("Ok", Command.OK, 0);//GEN-LINE:|308-getter|1|308-postInit
        // write post-init user code here
        }//GEN-BEGIN:|308-getter|2|
        return cmdOkListInvest;
    }
    //</editor-fold>//GEN-END:|308-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: alertRelGR ">//GEN-BEGIN:|311-getter|0|311-preInit
    /**
     * Returns an initiliazed instance of alertRelGR component.
     * @return the initialized component instance
     */
    public Alert getAlertRelGR() {
        if (alertRelGR == null) {//GEN-END:|311-getter|0|311-preInit
            // write pre-init user code here
            alertRelGR = new Alert("Informa\u00E7\u00E3o!", null, null, AlertType.WARNING);//GEN-BEGIN:|311-getter|1|311-postInit
            alertRelGR.addCommand(getCmdBackAlertRelGRRelGR());
            alertRelGR.setCommandListener(this);
            alertRelGR.setTimeout(Alert.FOREVER);//GEN-END:|311-getter|1|311-postInit
            // write post-init user code here
        }//GEN-BEGIN:|311-getter|2|
        return alertRelGR;
    }
    //</editor-fold>//GEN-END:|311-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdBackAlertRelGRRelGR ">//GEN-BEGIN:|312-getter|0|312-preInit
    /**
     * Returns an initiliazed instance of cmdBackAlertRelGRRelGR component.
     * @return the initialized component instance
     */
    public Command getCmdBackAlertRelGRRelGR() {
        if (cmdBackAlertRelGRRelGR == null) {//GEN-END:|312-getter|0|312-preInit
            // write pre-init user code here
            cmdBackAlertRelGRRelGR = new Command("Back", Command.BACK, 0);//GEN-LINE:|312-getter|1|312-postInit
            // write post-init user code here
        }//GEN-BEGIN:|312-getter|2|
        return cmdBackAlertRelGRRelGR;
    }
    //</editor-fold>//GEN-END:|312-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: font ">//GEN-BEGIN:|315-getter|0|315-preInit
    /**
     * Returns an initiliazed instance of font component.
     * @return the initialized component instance
     */
    public Font getFont() {
        if (font == null) {//GEN-END:|315-getter|0|315-preInit
            // write pre-init user code here
            font = Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD | Font.STYLE_UNDERLINED, Font.SIZE_LARGE);//GEN-LINE:|315-getter|1|315-postInit
            // write post-init user code here
        }//GEN-BEGIN:|315-getter|2|
        return font;
    }
    //</editor-fold>//GEN-END:|315-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: frmVisRelGR ">//GEN-BEGIN:|316-getter|0|316-preInit
    /**
     * Returns an initiliazed instance of frmVisRelGR component.
     * @return the initialized component instance
     */
    public Form getFrmVisRelGR() {
        if (frmVisRelGR == null) {//GEN-END:|316-getter|0|316-preInit
            // write pre-init user code here
            frmVisRelGR = new Form("Relatorio", new Item[] { getTbRelGR() });//GEN-BEGIN:|316-getter|1|316-postInit
            frmVisRelGR.addCommand(getCmdOKFrmVisRelGR());
            frmVisRelGR.setCommandListener(this);//GEN-END:|316-getter|1|316-postInit
            // write post-init user code here
        }//GEN-BEGIN:|316-getter|2|
        return frmVisRelGR;
    }
    //</editor-fold>//GEN-END:|316-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: tbRelGR ">//GEN-BEGIN:|319-getter|0|319-preInit
    /**
     * Returns an initiliazed instance of tbRelGR component.
     * @return the initialized component instance
     */
    public TableItem getTbRelGR() {
        if (tbRelGR == null) {//GEN-END:|319-getter|0|319-preInit
            // write pre-init user code here
            tbRelGR = new TableItem(getDisplay(), "");//GEN-BEGIN:|319-getter|1|319-postInit
            tbRelGR.setLayout(ImageItem.LAYOUT_DEFAULT);
            tbRelGR.setTitle("Teste");
            tbRelGR.setModel(getTableModel());
            tbRelGR.setHeadersFont(getFont());//GEN-END:|319-getter|1|319-postInit
            // write post-init user code here
        }//GEN-BEGIN:|319-getter|2|
        return tbRelGR;
    }
    //</editor-fold>//GEN-END:|319-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdOKFrmVisRelGR ">//GEN-BEGIN:|317-getter|0|317-preInit
    /**
     * Returns an initiliazed instance of cmdOKFrmVisRelGR component.
     * @return the initialized component instance
     */
    public Command getCmdOKFrmVisRelGR() {
        if (cmdOKFrmVisRelGR == null) {//GEN-END:|317-getter|0|317-preInit
            // write pre-init user code here
            cmdOKFrmVisRelGR = new Command("Ok", Command.OK, 0);//GEN-LINE:|317-getter|1|317-postInit
            // write post-init user code here
        }//GEN-BEGIN:|317-getter|2|
        return cmdOKFrmVisRelGR;
    }
    //</editor-fold>//GEN-END:|317-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: tableModel ">//GEN-BEGIN:|320-getter|0|320-preInit
    /**
     * Returns an initiliazed instance of tableModel component.
     * @return the initialized component instance
     */
    public SimpleTableModel getTableModel() {
        if (tableModel == null) {//GEN-END:|320-getter|0|320-preInit
            // write pre-init user code here
            tableModel = new SimpleTableModel(new java.lang.String[][] {//GEN-BEGIN:|320-getter|1|320-postInit
                new java.lang.String[] { "", "", "" }}, new java.lang.String[] { "DATA", "NOME", "VALOR" });//GEN-END:|320-getter|1|320-postInit
            // write post-init user code here
        }//GEN-BEGIN:|320-getter|2|
        return tableModel;
    }
    //</editor-fold>//GEN-END:|320-getter|2|

    /**
     * Returns a display instance.
     * @return the display instance.
     */
    public Display getDisplay() {
        return Display.getDisplay(this);
    }

    /**
     * Exits MIDlet.
     */
    public void exitMIDlet() {
        switchDisplayable(null, null);
        destroyApp(true);
        notifyDestroyed();
    }

    /**
     * Called when MIDlet is started.
     * Checks whether the MIDlet have been already started and initialize/starts or resumes the MIDlet.
     */
    public void startApp() {
        if (midletPaused) {
            resumeMIDlet();
        } else {
            initialize();
            startMIDlet();
        }
        midletPaused = false;
    }

    /**
     * Called when MIDlet is paused.
     */
    public void pauseApp() {
        midletPaused = true;
    }

    /**
     * Called to signal the MIDlet to terminate.
     * @param unconditional if true, then the MIDlet has to be unconditionally terminated and all resources has to be released.
     */
    public void destroyApp(boolean unconditional) {
    }

    private void limpaTelaGastosReceitas() {
        txtNomeGR.setString("");
        txtDescricaoGR.setString("");
        txtValorGR.setString("");
        cgTipoGR.deleteAll();
        cgCompensadoGR.setSelectedIndex(0, false);
        dfDataEmissaoGR.setDate(new java.util.Date(System.currentTimeMillis()));
        dfDataPagamentoGR.setDate(new java.util.Date(System.currentTimeMillis()));
        dfDataVencimentoGR.setDate(new java.util.Date(System.currentTimeMillis()));
        if (txtQuantDiasGR != null && txtNumParcelasGR != null) {
            txtQuantDiasGR.setString("");
            txtNumParcelasGR.setString("");
        }
    }

    private void limpaTelaInvestimento() {
        txtNome.setString("");
        txtDescricao.setString("");
        txtValorAntInvest.setString("");
        txtValorUltAt.setString("");
        dfDataUltAt.setDate(new java.util.Date(System.currentTimeMillis()));
        txtValorUltAt.setString("");
    }

    private void preencheTelaGastosReceitas() {
        getCgTipoGR().append(gastosReceitas.getTipoGR().getId() + " - " + gastosReceitas.getTipoGR().getNome(), null);
        getTxtNomeGR().setString(gastosReceitas.getNome());
        getTxtDescricaoGR().setString(gastosReceitas.getDescricao());
        getTxtValorGR().setString(String.valueOf(gastosReceitas.getValor()));
        getDfDataEmissaoGR().setDate(gastosReceitas.getDataEmissao());
        getDfDataPagamentoGR().setDate(gastosReceitas.getDataPagamento());
        getDfDataVencimentoGR().setDate(gastosReceitas.getDataVencimento());
        getCgCompensadoGR().setSelectedIndex(0, gastosReceitas.isCompensado());
    }

    private void preencheTelaInvestimento() {
        txtNome.setString(investimento.getNome());
        txtDescricao.setString(investimento.getDescricao());
        txtValorAntInvest.setString(String.valueOf(investimento.getValorAnterior()));
        txtValorUltAt.setString(String.valueOf(investimento.getValorAtual()));
        dfDataUltAt.setDate(investimento.getDataUltAt());
    }

    public TextField getTxtNumParcelasGR() {
        if (txtNumParcelasGR == null) {
            // write pre-init user code here
            txtNumParcelasGR = new TextField("Numero de parcelas:", null, 4, TextField.NUMERIC);
        // write post-init user code here
        }
        return txtNumParcelasGR;
    }

    public TextField getTxtQuantDiasGR() {
        if (txtQuantDiasGR == null) {
            // write pre-init user code here
            txtQuantDiasGR = new TextField("Quantidade de dias:", null, 4, TextField.NUMERIC);
        // write post-init user code here
        }
        return txtQuantDiasGR;
    }
    
    private boolean validaFiltroRelGastoReceita() {
        return getCgRelGastosReceitas().isSelected(0) || getCgRelGastosReceitas().isSelected(1);
    }

    private char verificaTipoData() {
        if (getCgData().getSelectedIndex() == 0) {
            return 'E';
        } else if (getCgData().getSelectedIndex() == 1) {
            return 'V';
        } else {
            return 'P';
        }

    }

    /**
     * 
     * @return Retorna 0 para os dois tipos de lançamentos informados (Gasto ou receitas)
     * se 1 retorna Gasto, se 2 retorna Receitas
     */
    private int verificaTipoLancamentoRelGR() {
        if (getCgRelGastosReceitas().isSelected(0) && getCgRelGastosReceitas().isSelected(1)) {
            return 0;
        } else if (getCgRelGastosReceitas().isSelected(0)) {
            return 1;
        } else {
            return 2;
        }
    }
    
    private String montaTexto() {
        int tipoLancamento = verificaTipoLancamentoRelGR();
        char tipoData = verificaTipoData();
        ObjectSet os = null;
        GastosReceitas auxGR = new GastosReceitas();
        GastoReceitasDataComparator grDataComp = new GastoReceitasDataComparator(tipoData);
        double debito=0.0, credito=0.0;
        switch (tipoLancamento) {
            case 0:
                getTbxRelatorio().setTitle("Relatório de Gastos e Receitas");
                getFrmVisRelGR().setTitle("Relatório de Gastos e Receitas");
                getTbRelGR().setTitle("Tabela de Gastos e Receitas");
                switch (tipoData) {
                    case 'E':
                        os = fu.findFilterAndComparator(auxGR, new GastoReceitasFilter(gUsuario, null, ' '),grDataComp);
                        break;
                    case 'V':
                        os = fu.findFilterAndComparator(auxGR, new GastoReceitasFilter(gUsuario, null, ' '),grDataComp);
                        break;
                    case 'P':
                        os = fu.findFilterAndComparator(auxGR, new GastoReceitasFilter(gUsuario, null, ' '),grDataComp);
                        break;
                }
                break;
            case 1:
                getTbxRelatorio().setTitle("Relatório de Gastos");
                getFrmVisRelGR().setTitle("Relatório de Gastos");
                getTbRelGR().setTitle("Tabela de Gastos");
                switch (tipoData) {
                    case 'E':
                        os = fu.findFilterAndComparator(auxGR, new GastoReceitasFilter(gUsuario, "D", 'T'),grDataComp);
                        break;
                    case 'V':
                        os = fu.findFilterAndComparator(auxGR, new GastoReceitasFilter(gUsuario, "D", 'T'),grDataComp);
                        break;
                    case 'P':
                        os = fu.findFilterAndComparator(auxGR, new GastoReceitasFilter(gUsuario, "D", 'T'),grDataComp);
                        break;
                }
                break;
            case 2:
                getTbxRelatorio().setTitle("Relatório de Receitas");
                getFrmVisRelGR().setTitle("Relatório de Receitas");                
                getTbRelGR().setTitle("Tabela de Receitas");
                switch (tipoData) {
                    case 'E':
                        os = fu.findFilterAndComparator(auxGR, new GastoReceitasFilter(gUsuario, "C", 'T'),grDataComp);
                        break;
                    case 'V':
                        os = fu.findFilterAndComparator(auxGR, new GastoReceitasFilter(gUsuario, "C", 'T'),grDataComp);
                        break;
                    case 'P':
                        os = fu.findFilterAndComparator(auxGR, new GastoReceitasFilter(gUsuario, "C", 'T'),grDataComp);
                        break;
                }
                break;
        }
        StringBuffer sb = new StringBuffer();
        sb.setLength(getTbxRelatorio().getMaxSize());
        sb.append("DATA | NOME | VALOR\n");
        tableModel = new SimpleTableModel(os.size()+2, 3);        
        getTableModel().setColumnNames(new String[] {"DATA","NOME","VALOR"});
        
        for (int i = 0; i < os.size(); i++) {
            try {
                auxGR = (GastosReceitas) os.get(i);
            } catch (FloggyException ex) {
                ex.printStackTrace();
            }
            switch (tipoData) {
                case 'E':
                    if ((auxGR.getDataEmissao().getTime() >= getDfDeRelGR().getDate().getTime()) && (auxGR.getDataEmissao().getTime() <= getDfAteRelGR().getDate().getTime())) {
                        sb.append(Calendario.retornaDataDDMMAAAA(auxGR.getDataEmissao())).append(" | ").append(auxGR.getNome()).append(" | ");
                        getTableModel().setValue(0, i, Calendario.retornaDataDDMMAAAA(auxGR.getDataEmissao()));
                        getTableModel().setValue(1, i, auxGR.getNome());                        
                        if(auxGR.getTipoGR().getDebitoCredito()=='D'){
                            sb.append(String.valueOf(auxGR.getValor()*-1)).append(" \n");
                            getTableModel().setValue(2, i, String.valueOf(auxGR.getValor()*-1));
                            debito+=auxGR.getValor();
                        }else{
                            sb.append(String.valueOf(auxGR.getValor())).append(" \n");
                            getTableModel().setValue(2, i, String.valueOf(auxGR.getValor()));
                            credito+=auxGR.getValor();
                        }
                        break;
                    }
                case 'V':
                    if ((auxGR.getDataVencimento().getTime() >= getDfDeRelGR().getDate().getTime()) && (auxGR.getDataVencimento().getTime() <= getDfAteRelGR().getDate().getTime())) {
                        sb.append(Calendario.retornaDataDDMMAAAA(auxGR.getDataVencimento())).append(" | ").append(auxGR.getNome()).append(" | ");
                        getTableModel().setValue(0, i, Calendario.retornaDataDDMMAAAA(auxGR.getDataVencimento()));
                        getTableModel().setValue(1, i, auxGR.getNome()); 
                        if(auxGR.getTipoGR().getDebitoCredito()=='D'){
                            sb.append(String.valueOf(auxGR.getValor()*-1)).append(" \n");
                            getTableModel().setValue(2, i, String.valueOf(auxGR.getValor()*-1));
                            debito+=auxGR.getValor();
                        }else{
                            sb.append(String.valueOf(auxGR.getValor())).append(" \n");
                            getTableModel().setValue(2, i, String.valueOf(auxGR.getValor()));
                            credito+=auxGR.getValor();
                        }                        
                        break;
                    }
                case 'P':
                    if ((auxGR.getDataPagamento().getTime() >= getDfDeRelGR().getDate().getTime()) && (auxGR.getDataPagamento().getTime() <= getDfAteRelGR().getDate().getTime())) {
                        sb.append(Calendario.retornaDataDDMMAAAA(auxGR.getDataPagamento())).append(" | ").append(auxGR.getNome()).append(" | ");
                        getTableModel().setValue(0, i, Calendario.retornaDataDDMMAAAA(auxGR.getDataPagamento()));
                        getTableModel().setValue(1, i, auxGR.getNome());
                        if(auxGR.getTipoGR().getDebitoCredito()=='D'){
                            sb.append(String.valueOf(auxGR.getValor()*-1)).append(" \n");
                            getTableModel().setValue(2, i, String.valueOf(auxGR.getValor()*-1));
                            debito+=auxGR.getValor();
                        }else{
                            sb.append(String.valueOf(auxGR.getValor())).append(" \n");
                            getTableModel().setValue(2, i, String.valueOf(auxGR.getValor()));
                            credito+=auxGR.getValor();
                        }                        
                        break;
                    }
            }
        }
        sb.append("\n");
        getTableModel().setValue(0, os.size()+1, "Totais");
        switch (tipoLancamento) {
            case 0:
                sb.append("Débito: ").append(debito).append(" | Crédito: ").append(credito);
                getTableModel().setValue(1, os.size()+1, "Débito: " + String.valueOf(debito));
                getTableModel().setValue(2, os.size()+1, "Crédito: " + String.valueOf(credito));
                break;
            case 1:
                sb.append("Débito: ").append(debito);
                getTableModel().setValue(2, os.size()+1, "Débito: " + String.valueOf(debito));
                break;
            case 2:
                sb.append("Crédito: ").append(credito);
                getTableModel().setValue(2, os.size()+1, "Crédito: " + String.valueOf(credito));
                break;
        }
        return sb.toString().trim();
    }    
}